-
Notifications
You must be signed in to change notification settings - Fork 51
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
How I got it working #107
Comments
Adjustment for NPM For NPM this goes in the advanced settings location / { location {location of your static folder}/static/ { location {location of your media folder}/media/ { |
Can I ask what your .env file looks like? I have a very similiar setup also using NPM without celery and nginx but can't get it to work. docker-compose.yml:
Custom Nginx Configuration:
|
Note that using folders directly does cause problems (I have added a warning to the docs right now), if you get a set of steps to do so that everything works, I'll gladly add it to the readme |
What do you mean directly? Can you elaborate on that for clarification? Thanks |
@deboy69 sure, I mean mounting folders instead of using the volumes, so |
You maybe like me and stuggled for days to get this to work. There are so many little errors in this project that don't really get fixed. 1. permissions and 2. django set to false (causes it not to load properly). I used portainer which needs stack.env instead of prod.env to run. Adjust either way you use it.
Here is what I used to get this working. I dont use celery and I dont use the included Nginx, I use NPM. Once you get it up for the first time, chmod 777 -R /static and chmod 777 -R /media. Re run the container again. ssh into the container didnt work for me so I used portainer cmd. Hope this helps
once into the container run the following.
python3manage.py sync-exercies
python3 manage.py download-exercise-images
python3 manage.py download-exercise-videos/
python3 manage.py sync-ingredients
Portainer stack or you can use compose.
services:
web:
image: wger/server:latest
env_file:
- stack.env
volumes:
- your local path/wger/static:/home/wger/static:rw
- your local path/wger/media:/home/wger/media:rw
environment:
- UMASK=022
- PUID=0
- PGID=0
ports:
- 8011:8000 #change 8011 if you have 8000 in use already
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:8000
interval: 10s
timeout: 5s
start_period: 300s
retries: 5
db:
image: postgres:15-alpine
environment:
- POSTGRES_USER=wger
- POSTGRES_PASSWORD=wger
- POSTGRES_DB=wger
volumes:
- your local path/ wger/postgres-data:/var/lib/postgresql/data
expose:
- 5432
restart: unless-stopped
healthcheck:
test: pg_isready -U wger
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
########################################################
cache:
image: redis
expose:
- 6379
volumes:
-your local path/wger/redis-data:/data
restart: unless-stopped
healthcheck:
test: redis-cli ping
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
##########################################################
networks:
default:
name: wger_network
#############################################################################################
For NPM this goes in the advanced settings
location / {
proxy_pass http://ip address:port#
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_redirect off;
}
location /static/ {
alias /wger/static/;
}
location /media/ {
alias /wger/media/;
}
The text was updated successfully, but these errors were encountered: