version: "3.9" services: postgres: image: postgres:16 restart: unless-stopped environment: POSTGRES_DB: ses POSTGRES_USER: ses POSTGRES_PASSWORD: ses ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ses -d ses"] interval: 10s timeout: 5s retries: 5 api: build: context: . dockerfile: Dockerfile.api restart: unless-stopped env_file: - .env environment: DATABASE_URL: postgresql+psycopg://ses:ses@postgres:5432/ses SES_LOG_LEVEL: INFO SES_SANDBOX_ROOT: /app/data/sandbox_runs SES_DOCKER_ENABLED: "true" ports: - "8000:8000" depends_on: postgres: condition: service_healthy volumes: - ./data:/app/data healthcheck: test: ["CMD", "python", "-c", "from api.gateway.main import app; print(app.title)"] interval: 30s timeout: 10s retries: 3 worker: build: context: . dockerfile: Dockerfile.worker restart: unless-stopped env_file: - .env environment: DATABASE_URL: postgresql+psycopg://ses:ses@postgres:5432/ses SES_LOG_LEVEL: INFO SES_SANDBOX_ROOT: /app/data/sandbox_runs SES_DOCKER_ENABLED: "true" depends_on: postgres: condition: service_healthy volumes: - ./data:/app/data volumes: postgres_data: