Skip to content
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

Wgner do not load CSS and exercises at all #32

Open
matijastampfel opened this issue Sep 25, 2022 · 16 comments
Open

Wgner do not load CSS and exercises at all #32

matijastampfel opened this issue Sep 25, 2022 · 16 comments

Comments

@matijastampfel
Copy link

matijastampfel commented Sep 25, 2022

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
Copy link
Member

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
Copy link
Author

matijastampfel commented Sep 25, 2022

I did only 2 things add
ports:
- "8005:8000"

And
networks:
default:
name: wger_network
driver: bridge
ipam:
config:
- subnet: 172.62.57.0/24

@rolandgeider
Copy link
Member

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
Copy link
Author

To which port should I change ?

@rolandgeider
Copy link
Member

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

@matijastampfel
Copy link
Author

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
Copy link
Author

I did remove all volumes before

@rolandgeider
Copy link
Member

🤨🤨🤨

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

@matijastampfel
Copy link
Author

nginx:
image: nginx:stable
container_name: wger_nginx
depends_on:
- web
volumes:
- ./config/nginx.conf:/etc/nginx/conf.d/default.conf
- static:/wger/static:ro
- media:/wger/media:ro
ports:
- "8007:80"
healthcheck:
test: service nginx status
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped

@matijastampfel
Copy link
Author

matijastampfel commented Sep 25, 2022

I change it to 8007

I am getting same issue

Should I change in nginx:

upstream wger {
server web:8000;
}

?

@rolandgeider
Copy link
Member

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
Copy link

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
Copy link
Author

@rolandgeider any news regarding this issue ?

@testuser1223
Copy link

Having the same issue

@Muskelschlumpf
Copy link

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

@bbkz
Copy link

bbkz commented Mar 8, 2024

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:

  • Proxy to the django port for serving the rendered webpages
  • Serve the static and media files directly from the filesystem

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

  • nginx and django both needs access to the static and media volumes
  • nginx needs access to the port django runs on
  • django needs to be in productive mode

I hope this helps...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants