name: aeris services: db: image: postgres:16-alpine environment: POSTGRES_USER: ${POSTGRES_USER:-aeris} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env} POSTGRES_DB: ${POSTGRES_DB:-aeris} volumes: - pgdata:/var/lib/postgresql/data ports: - "${POSTGRES_PORT:-5433}:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] interval: 5s timeout: 3s retries: 10 redis: image: redis:7-alpine ports: - "${REDIS_PORT:-6379}:6379" healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 10 backend: build: ./backend env_file: .env environment: # Override the localhost URLs in .env with the compose service names DATABASE_URL: postgresql+psycopg://${POSTGRES_USER:-aeris}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB:-aeris} REDIS_URL: redis://redis:6379/0 DATA_DIR: /data volumes: - ./data:/data:ro depends_on: db: condition: service_healthy redis: condition: service_healthy ports: - "${BACKEND_PORT:-8000}:8000" healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/health', timeout=3)"] interval: 10s timeout: 5s start_period: 20s retries: 5 frontend: build: ./frontend depends_on: backend: condition: service_healthy ports: - "${FRONTEND_PORT:-8080}:80" volumes: pgdata: