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

How I got it working #107

Open
deboy69 opened this issue Oct 28, 2024 · 1 comment
Open

How I got it working #107

deboy69 opened this issue Oct 28, 2024 · 1 comment

Comments

@deboy69
Copy link

deboy69 commented Oct 28, 2024

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/;
}

@deboy69
Copy link
Author

deboy69 commented Oct 28, 2024

Adjustment for NPM

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 {location of your static folder}/static/ {
alias /wger/static/;
}

location {location of your media folder}/media/ {
alias /wger/media/;
}

@deboy69 deboy69 closed this as completed Oct 28, 2024
@deboy69 deboy69 reopened this Oct 28, 2024
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

1 participant