feat(worker): Add db_worker service with automatic restart and logging

feat(task_overview): Display generated series in task overview
docs(README): Update documentation for background task workers and troubleshooting
This commit is contained in:
Ross
2026-05-17 21:13:40 +01:00
parent ab9847e22e
commit c2d8376e22
8 changed files with 186 additions and 3 deletions
+14
View File
@@ -17,6 +17,20 @@ services:
- ../:/usr/src/app:cached
# Mount the app log directory so logs are visible on the host at ./logs
- ../logs:/var/log/rad
worker:
env_file:
- ../.env.dev
volumes:
- ../:/usr/src/app:cached
- ../logs:/var/log/rad
entrypoint:
[
"sh",
"-c",
"python manage.py migrate --noinput && exec python manage.py db_worker",
]
command: []
nginx:
# Development nginx override: mount a simplified config that does not
# reference LetsEncrypt certs so the container can start without real
+17
View File
@@ -30,6 +30,23 @@ services:
- 3459:3459
env_file:
- ./.env.dev.local
worker:
build:
context: ..
dockerfile: rad/Dockerfile
command: python manage.py db_worker
restart: unless-stopped
volumes:
- ../:/usr/src/app
- ../backups:/usr/src/app/backups
- ../media:/usr/src/app/media
- ../static:/usr/src/app/static
env_file:
- ./.env.dev.local
depends_on:
- web
- db
db:
image: postgres:14.2-alpine
volumes:
+24
View File
@@ -35,6 +35,30 @@ services:
- "8000"
command: ["/usr/src/app/entrypoint.sh"]
worker:
build:
context: ..
dockerfile: rad/Dockerfile.prod
restart: always
env_file:
- ../.env.${COMPOSE_ENV:-prod}
environment:
- DJANGO_SETTINGS_MODULE=rad.settings
depends_on:
redis:
condition: service_healthy
web:
condition: service_started
volumes:
- ../deploy/settings_local.py:/usr/src/app/rad/settings_local.py:ro
- ../logs:/var/log/rad:rw
entrypoint:
[
"sh",
"-c",
"python manage.py migrate --noinput && exec python manage.py db_worker",
]
nginx:
image: nginx:stable-alpine
restart: always