services: db: image: postgres:16-alpine container_name: lothar_collatz_db restart: unless-stopped environment: POSTGRES_DB: ${POSTGRES_DB:-lothar_collatz} POSTGRES_USER: ${POSTGRES_USER:-postgres} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-adminadmin} ports: - '${POSTGRES_PORT:-5432}:5432' volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: [ 'CMD-SHELL', 'pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-lothar_collatz}' ] interval: 5s timeout: 5s retries: 10 backend: build: context: ./backend dockerfile: Dockerfile container_name: lothar_collatz_backend restart: unless-stopped environment: DATABASE_URL: postgresql+psycopg://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-adminadmin}@db:5432/${POSTGRES_DB:-lothar_collatz} API_CORS_ORIGINS: ${API_CORS_ORIGINS:-http://localhost:5173} ports: - '${BACKEND_PORT:-8000}:8000' depends_on: db: condition: service_healthy frontend: build: context: ./frontend dockerfile: Dockerfile args: VITE_API_BASE: ${VITE_API_BASE:-http://localhost:8000} container_name: lothar_collatz_frontend restart: unless-stopped ports: - '${FRONTEND_PORT:-5173}:80' depends_on: backend: condition: service_started volumes: postgres_data: