closer to a full instrumentation stack

This commit is contained in:
2024-12-07 17:05:02 -06:00
parent 7a29dbd3c7
commit eb2f116d7b
18 changed files with 52 additions and 84 deletions

View File

@@ -0,0 +1,28 @@
upstream wger {
server wger-web:2003;
}
server {
listen 80;
location / {
proxy_pass http://wger;
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/;
}
# Increase max body size to allow for video uploads
client_max_body_size 100M;
}

View File

@@ -0,0 +1,116 @@
# Please consult the `Deployment` section in the readme if you want to deploy
# this. You *need* to keep this nginx service, even if you have your own,
# otherwise the static files will not be served correctly! If you do remove
# it, configure yours similarly to what's in config/nginx.conf
# Also take a look at the "Static files" section in the .env file
services:
wger-web:
image: wger/server:latest
depends_on:
wger-db:
condition: service_healthy
wger-cache:
condition: service_healthy
#env_file:
# - ./config/prod.env
volumes:
- wger-static:/home/wger/static
expose:
- 2003
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:8000
interval: 10s
timeout: 5s
start_period: 300s
retries: 5
restart: unless-stopped
wger-nginx:
image: nginx:stable
depends_on:
- wger-web
volumes:
- ./config/nginx.conf:/etc/nginx/conf.d/default.conf
- wger-static:/wger/static:ro
- wger-media:/wger/media:ro
ports:
- "80:80"
healthcheck:
test: service nginx status
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
wger-db:
image: postgres:15-alpine
environment:
- POSTGRES_USER=wger
- POSTGRES_PASSWORD=wger
- POSTGRES_DB=wger
volumes:
- wger-postgres-data:/var/lib/postgresql/data/
expose:
- 5432
healthcheck:
test: pg_isready -U wger
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
wger-cache:
image: redis:latest
expose:
- 6379
volumes:
- wger-redis-data:/data
healthcheck:
test: redis-cli ping
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
wger-celery_worker:
image: wger/server:latest
command: /start-worker
#env_file:
# - ./config/prod.env
volumes:
- wger-media:/home/wger/media
depends_on:
wger-web:
condition: service_healthy
healthcheck:
test: celery -A wger inspect ping
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
wger-celery_beat:
image: wger/server:latest
command: /start-beat
volumes:
- wger-celery-beat:/home/wger/beat/
#env_file:
# - ./config/prod.env
depends_on:
wger-celery_worker:
condition: service_healthy
volumes:
wger-postgres-data:
wger-celery-beat:
wger-static:
wger-media:
wger-redis-data:
networks:
default:
name: wger_network

7
inprep/wger/update.sh Normal file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
docker compose exec wger-web python3 manage.py sync-exercises
docker compose exec wger-web python3 manage.py download-exercise-images
docker compose exec wger-web python3 manage.py download-exercise-videos
docker compose exec wger-web wger load-online-fixtures
docker compose exec wger-web python3 manage.py sync-ingredients