services: backend: build: # Compose file is backend/infra/docker; use the repository root so the # image can build the frontend and copy the backend in one reproducible build. context: ../../.. dockerfile: backend/infra/docker/Dockerfile.backend image: dealerhub-backend:latest restart: unless-stopped environment: DJANGO_SETTINGS_MODULE: config.settings.prod DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY:?required} DATABASE_URL: postgres://dealerhub:${POSTGRES_PASSWORD}@db:5432/dealerhub GRANIAN_WORKERS: "4" depends_on: db: condition: service_healthy volumes: - media:/app/media - staticfiles:/app/staticfiles ports: - "8000:8000" db: image: postgres:16-alpine restart: unless-stopped environment: POSTGRES_DB: dealerhub POSTGRES_USER: dealerhub POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?required} volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U dealerhub"] interval: 5s timeout: 3s retries: 10 volumes: pgdata: media: staticfiles: