services: # Use this for external databases (Supabase, Neon, etc.) # Command: docker-compose --profile external-db up app: profiles: ["external-db"] build: . env_file: .env environment: # Override WORKSPACE_PATH for container (host path differs from container path) WORKSPACE_PATH: /workspace ports: - "${PORT:-3000}:${PORT:-3000}" volumes: - ${WORKSPACE_PATH:-./workspace}:/workspace restart: unless-stopped dns: - 8.8.8.8 - 8.8.4.4 sysctls: - net.ipv6.conf.all.disable_ipv6=1 # Use this for local Docker database # Command: docker-compose --profile with-db up app-with-db: profiles: ["with-db"] build: . env_file: .env environment: # Override DATABASE_URL to use Docker service name DATABASE_URL: postgresql://postgres:postgres@postgres:5432/remote_coding_agent # Override WORKSPACE_PATH for container (host path differs from container path) WORKSPACE_PATH: /workspace ports: - "${PORT:-3000}:${PORT:-3000}" volumes: - ${WORKSPACE_PATH:-./workspace}:/workspace restart: unless-stopped dns: - 8.8.8.8 - 8.8.4.4 sysctls: - net.ipv6.conf.all.disable_ipv6=1 depends_on: postgres: condition: service_healthy postgres: image: postgres:18 profiles: ["with-db"] environment: POSTGRES_DB: remote_coding_agent POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres volumes: - postgres_data:/var/lib/postgresql # Auto-run combined migration on first startup - ./migrations/000_combined.sql:/docker-entrypoint-initdb.d/000_combined.sql:ro # Mount all migrations for manual updates (accessible via /migrations inside container) - ./migrations:/migrations:ro ports: - "${POSTGRES_PORT:-5432}:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 5s retries: 5 volumes: postgres_data: