wger-project / docker

Production...ish docker-compose image for wger
GNU Affero General Public License v3.0
125 stars 43 forks source link

Wgner do not load CSS and exercises at all #32

Open matijastampfel opened 2 years ago

matijastampfel commented 2 years ago

When I load home page there is no CSS or pictures at all.

Console:

GET http://192.168.1.248:8005/static/CACHE/css/output.bb29faf5c6cc.css net::ERR_ABORTED 404 (Not Found) features:55 GET http://192.168.1.248:8005/static/CACHE/js/output.47a47acd93ca.js net::ERR_ABORTED 404 (Not Found) features:329 GET http://192.168.1.248:8005/static/yarn/shariff/dist/shariff.min.js net::ERR_ABORTED 404 (Not Found) features:158 GET http://192.168.1.248:8005/static/images/weight-chart.png 404 (Not Found) features:173 GET http://192.168.1.248:8005/static/images/calendar.png 404 (Not Found) features:218 GET http://192.168.1.248:8005/static/images/rest-api.png 404 (Not Found) features:203 GET http://192.168.1.248:8005/static/images/gym-management.png 404 (Not Found) features:188 GET http://192.168.1.248:8005/static/images/muscle-overview.png 404 (Not Found) favicon.png:1 GET http://192.168.1.248:8005/static/images/favicon.png 404 (Not Found)

Please help

rolandgeider commented 2 years ago

Hi! Mhhh this is strange, did you change something in the config or compose file? If not, could you delete the volumes and start the containers again?

matijastampfel commented 2 years ago

I did only 2 things add ports:

And networks: default: name: wger_network driver: bridge ipam: config:

rolandgeider commented 2 years ago

If you want to change the port you need to change the nginx port in line 40 (the static files are served by it, otherwise you are accessing the application directly and all the css files are missing)

matijastampfel commented 2 years ago

To which port should I change ?

rolandgeider commented 2 years ago

if you want to access the application over 8005, then simply to "8005:80"

matijastampfel commented 2 years ago

ERROR: for wger_nginx Cannot start service nginx: driver failed programming external connectivity on endpoint wger_nginx (d2150f3fbc42999da1b1a34458871caca4fa21113d3c282636ffddad5988a955): Bind for 0.0.0.0:8005 failed: port is already allocated

ERROR: for nginx Cannot start service nginx: driver failed programming external connectivity on endpoint wger_nginx (d2150f3fbc42999da1b1a34458871caca4fa21113d3c282636ffddad5988a955): Bind for 0.0.0.0:8005 failed: port is already allocated ERROR: Encountered errors while bringing up the project.

matijastampfel commented 2 years ago

I did remove all volumes before

rolandgeider commented 2 years ago

🤨🤨🤨

Is that port already used by something else in your network? Can you change it to something else?

matijastampfel commented 2 years ago

nginx: image: nginx:stable container_name: wger_nginx depends_on:

matijastampfel commented 2 years ago

I change it to 8007

I am getting same issue

Should I change in nginx:

upstream wger { server web:8000; }

?

rolandgeider commented 2 years ago

no, just the one line in nginx is enough. I honestly don't know what else to try, it just seems there is something else blocking the port

DetectiveBeef commented 2 years ago

So I am running into the same error. I am running a docker image on an unraid setup. I get the following after a successful startup:

Starting development server at http://0.0.0.0:8000/ Quit the server with CONTROL-C. [25/Sep/2022 21:05:57] "GET / HTTP/1.1" 302 0 [25/Sep/2022 21:05:57] "GET /en/ HTTP/1.1" 302 0 [25/Sep/2022 21:05:57] "GET /en/software/features HTTP/1.1" 200 14872 [25/Sep/2022 21:05:57] "GET /static/CACHE/css/output.10d45dee13d8.css HTTP/1.1" 404 2762 [25/Sep/2022 21:05:57] "GET /static/CACHE/js/output.47a47acd93ca.js HTTP/1.1" 404 2762 [25/Sep/2022 21:05:57] "GET /static/yarn/shariff/dist/shariff.min.js HTTP/1.1" 404 2762 [25/Sep/2022 21:05:57] "GET /static/images/weight-chart.png HTTP/1.1" 404 2762 [25/Sep/2022 21:05:57] "GET /static/images/calendar.png HTTP/1.1" 404 2762 [25/Sep/2022 21:05:57] "GET /static/images/muscle-overview.png HTTP/1.1" 404 2762 [25/Sep/2022 21:05:57] "GET /static/images/rest-api.png HTTP/1.1" 404 2762 [25/Sep/2022 21:05:57] "GET /static/images/gym-management.png HTTP/1.1" 404 2762 [25/Sep/2022 21:05:58] "GET /static/images/favicon.png HTTP/1.1" 404 2762

All I have changed from the original config is the port at which is access' it over

matijastampfel commented 1 year ago

@rolandgeider any news regarding this issue ?

testuser1223 commented 1 year ago

Having the same issue

Muskelschlumpf commented 7 months ago

Hi, I have the same Issue. No Pictures at all. Does someone solved this?

bbkz commented 7 months ago

Hi,

sometimes it is helpful to know the following general overview on how django works.

Running Django in "development" mode will serve the static (js, css, ...) files and the media (images, ...) files directly from the source code and serve on the port django runs. But this is not the case for a productive environment.

In the productive mode, starting up django will copy all needed (changed) static files to the defined storage (volumes) and only serve the rendered pages. The django port is not ment to be access directly from the user, but from a webserver (proxy).

The user accesses trough a webserver like nginx, this is the only Port the users must have access to. As for nginx it will serve basically two things:

So Users -> Nginx Port -> Django Port and Users -> Nginx Port -> Filesystem needs to work to serve the pages.

I hope this helps...