135 lines
3.3 KiB
YAML
135 lines
3.3 KiB
YAML
version: "3.9"
|
|
|
|
networks:
|
|
traefik:
|
|
external: true
|
|
|
|
services:
|
|
web:
|
|
image: wger/server:latest
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
cache:
|
|
condition: service_healthy
|
|
networks:
|
|
- default
|
|
env_file:
|
|
- /mnt/tank/appdata/wger/config/prod.env
|
|
volumes:
|
|
- /mnt/tank/appdata/wger/static:/home/wger/static
|
|
- /mnt/tank/appdata/wger/media:/home/wger/media
|
|
expose:
|
|
- 8000
|
|
healthcheck:
|
|
test: wget --no-verbose --tries=1 --spider http://localhost:8000
|
|
interval: 10s
|
|
timeout: 5s
|
|
start_period: 300s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
nginx:
|
|
image: nginx:stable
|
|
depends_on:
|
|
- web
|
|
networks:
|
|
- traefik
|
|
- default
|
|
volumes:
|
|
- /mnt/tank/appdata/wger/config/nginx.conf:/etc/nginx/conf.d/default.conf
|
|
- /mnt/tank/appdata/wger/static:/wger/static:ro
|
|
- /mnt/tank/appdata/wger/media:/wger/media:ro
|
|
healthcheck:
|
|
test: service nginx status
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
restart: unless-stopped
|
|
labels:
|
|
traefik.enable: true
|
|
traefik.http.routers.wger.rule: "Host(`wger.mjwilson.org`)"
|
|
#traefik.http.services.wger.loadbalancer.server.port: 8000
|
|
#traefik.http.routers.wger.middlewares: lan-whitelist@file
|
|
|
|
db:
|
|
image: postgres:15-alpine
|
|
environment:
|
|
- POSTGRES_USER=wger
|
|
- POSTGRES_PASSWORD=wger
|
|
- POSTGRES_DB=wger
|
|
- TZ=Europe/Berlin
|
|
networks:
|
|
- default
|
|
volumes:
|
|
- /mnt/tank/appdata/postgres/wger:/var/lib/postgresql/data/
|
|
expose:
|
|
- 5432
|
|
healthcheck:
|
|
test: pg_isready -U wger
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
restart: unless-stopped
|
|
|
|
cache:
|
|
image: redis
|
|
expose:
|
|
- 6379
|
|
networks:
|
|
- default
|
|
volumes:
|
|
- /mnt/tank/appdata/wger/config/redis.conf:/usr/local/etc/redis/redis.conf
|
|
- /mnt/tank/appdata/redis/wger/data:/data
|
|
command: [ "redis-server", "/usr/local/etc/redis/redis.conf"]
|
|
healthcheck:
|
|
test: redis-cli ping
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
restart: unless-stopped
|
|
|
|
# You probably want to limit the memory usage of the cache, otherwise it might
|
|
# hog all the available memory. Remove or change according to your needs.
|
|
#mem_limit: 2gb
|
|
|
|
celery_worker:
|
|
image: wger/server:latest
|
|
command: /start-worker
|
|
networks:
|
|
- default
|
|
env_file:
|
|
- /mnt/tank/appdata/wger/config/prod.env
|
|
volumes:
|
|
- /mnt/tank/appdata/wger/media:/home/wger/media
|
|
depends_on:
|
|
web:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: celery -A wger inspect ping
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
|
|
celery_beat:
|
|
image: wger/server:latest
|
|
command: /start-beat
|
|
networks:
|
|
- default
|
|
volumes:
|
|
- /mnt/tank/appdata/wger/celery-beat:/home/wger/beat/
|
|
env_file:
|
|
- /mnt/tank/appdata/wger/config/prod.env
|
|
depends_on:
|
|
celery_worker:
|
|
condition: service_healthy
|
|
|
|
|
|
# Heads up, if you remove these volumes and use folders directly you need to chown them
|
|
# to the UID and GID 1000 even if it doesn't exist on your system. Also, they should
|
|
# be readable by everyone.
|