# Betrieb: web (Django + gunicorn), worker (Ereignis-Queue), db (PostgreSQL). # Vorher .env aus .env.example anlegen. services: db: image: postgres:17 restart: unless-stopped environment: POSTGRES_DB: ${POSTGRES_DB} POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] interval: 5s retries: 10 web: build: . restart: unless-stopped env_file: .env command: > sh -c "python manage.py migrate --noinput && gunicorn config.wsgi:application --bind 0.0.0.0:8000 --workers 3" ports: - "8000:8000" depends_on: db: condition: service_healthy worker: build: . restart: unless-stopped env_file: .env command: python manage.py run_worker depends_on: db: condition: service_healthy volumes: pgdata: