New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wger on production docker doesn't use SITE_URL for images #1181
Comments
Hi! The |
Nope. I just got a new VPS and installed docker and docker-compose-plugin
2. Maybe something is changed in docker-compose 2 that breaks wger?
…On Wed, Nov 16, 2022, 2:58 PM Roland Geider ***@***.***> wrote:
Hi! The SITE_URL setting only controls things like the url used in
password reset links and such. The static files are served from /static
of the IP where wger is running. Did you change something in the docker
compose?
—
Reply to this email directly, view it on GitHub
<#1181 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABTM4ZHU35WXMGMI3CJRNG3WITAN7ANCNFSM6AAAAAASCCWAYM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Interesting. Is there perhaps some error in the logs? During Startup Django should collect and copy all the static files (or drop the volumes and try again) |
Thanks for your instant support. Here are the logs without any errors:
The URL of the instance is in the logs. Feel free to take a look with default admin user/pass if it helps (since it's a new installation I don't have any data to loose). |
Mhhh everything looks alright. Serving the static files is what produces the most issues to people, by far and is something I could never reproduce with this docker setup. Also that's something we don't have much control over, since they are just collected by Django but served via another process, in this case an nginx |
Why not just use SITE_URL or another environment variable for images? I don't know how to resolve this problem. Maybe I should go into the container and modify URLs manually to let it work for now. Although it's not a good solution but just to try it where should I look into? I'm not a Python expert, So it would be great if you can guide me. |
You can open the application and see which static files are being retrieved and try if you can access them with SITE_URL + those urs. And in any case, this is something that shouldn't be needed, nginx serves everything and if you want, you can put everything behind a reverse proxy so from the outside wger looks like a single application (which it is, in the end) |
oh, did you do something, it seems to be working now :) |
The server was down because I forgot to restart it sorry. But It's still not working for example see the screenshot below: The image prefixed address is http://localhost... |
Ahh, I know why only those don't work. These URLs come from the API which doesn't know the outside domain. There we could definitely use SITE_URL |
Yes but SITE_URL is correctly set as you can see in logs. It seems it's ignored for images. |
yeah, it's currently not used in the API |
Alright, have opened a new issue for the fix |
I thought I had fixed that. That part of the application is react which is embedded in the regular Django app. Making sure the CSS classes don't class was… fun |
It's fixed as stated in #1182. Thanks for your support. |
@rolandgeider should I create another issue for the screenshot I sent above? |
@mohammadrafigh yes please |
Steps to Reproduce
In production deployment using Docker, The images are returning from http://localhost instead of SITE_URL. I tried to clear cache but it doesn't work.
Expected results: The exercise images should be loaded.
Actual results: No image.
The text was updated successfully, but these errors were encountered: