fix: move cron job to dedicated compose service, avoids LXC runc PID errors
This commit is contained in:
@@ -46,6 +46,37 @@ services:
|
||||
volumes:
|
||||
- static_files:/app/staticfiles
|
||||
|
||||
# Runs the nightly coordinator status check (django-crontab job)
|
||||
# Avoids needing a cron daemon inside the web container, which causes
|
||||
# runc PID errors in unprivileged LXC environments.
|
||||
cron:
|
||||
build: .
|
||||
restart: unless-stopped
|
||||
entrypoint: >
|
||||
sh -c "echo '0 6 * * * python /app/manage.py nightly_check_active_status >> /proc/1/fd/1 2>&1'
|
||||
| crontab - && crond -f -d 8"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
SECRET_KEY: ${SECRET_KEY}
|
||||
DEBUG: ${DEBUG:-False}
|
||||
ALLOWED_HOSTS: ${ALLOWED_HOSTS:-localhost}
|
||||
SQL_ENGINE: django.db.backends.postgresql
|
||||
SQL_DATABASE: ${SQL_DATABASE:-busmanager}
|
||||
SQL_USER: ${SQL_USER:-busmanager}
|
||||
SQL_PASSWORD: ${SQL_PASSWORD}
|
||||
SQL_HOST: db
|
||||
SQL_PORT: 5432
|
||||
EMAIL_HOST: ${EMAIL_HOST:-}
|
||||
EMAIL_PORT: ${EMAIL_PORT:-25}
|
||||
AZURE_CLIENT_ID: ${AZURE_CLIENT_ID:-}
|
||||
AZURE_CLIENT_SECRET: ${AZURE_CLIENT_SECRET:-}
|
||||
AZURE_REDIRECT_URI: ${AZURE_REDIRECT_URI:-}
|
||||
AZURE_AUTHORITY: ${AZURE_AUTHORITY:-}
|
||||
TELSTRA_CLIENT_ID: ${TELSTRA_CLIENT_ID:-}
|
||||
TELSTRA_CLIENT_SECRET: ${TELSTRA_CLIENT_SECRET:-}
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
static_files:
|
||||
|
||||
Reference in New Issue
Block a user