############################################################################### # SteerPlane — Docker Compose # # Brings up all 3 services with one command: # docker compose up -d # # Copy .env.example to .env and fill in your values first. ############################################################################### services: # ─── PostgreSQL ──────────────────────────────────────────────────────── postgres: image: postgres:16-alpine restart: unless-stopped environment: POSTGRES_USER: ${POSTGRES_USER:-steerplane} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in your .env file — see .env.example} POSTGRES_DB: ${POSTGRES_DB:-steerplane} volumes: - pgdata:/var/lib/postgresql/data ports: - "${POSTGRES_PORT:-5432}:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-steerplane}"] interval: 5s timeout: 3s retries: 5 # ─── API Server (FastAPI) ────────────────────────────────────────────── api: build: context: ./api dockerfile: Dockerfile restart: unless-stopped ports: - "${API_PORT:-8000}:8000" environment: DATABASE_URL: postgresql://${POSTGRES_USER:-steerplane}:${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in your .env file — see .env.example}@postgres:5432/${POSTGRES_DB:-steerplane} CORS_ORIGINS: http://localhost:3000,http://dashboard:3000 STEERPLANE_ADMIN_TOKEN: ${STEERPLANE_ADMIN_TOKEN:-} STEERPLANE_DASHBOARD_URL: http://localhost:3000 DEBUG: ${DEBUG:-false} depends_on: postgres: condition: service_healthy # ─── Dashboard (Next.js) ─────────────────────────────────────────────── dashboard: build: context: ./dashboard dockerfile: Dockerfile args: NEXT_PUBLIC_API_URL: http://localhost:${API_PORT:-8000} restart: unless-stopped ports: - "${DASHBOARD_PORT:-3000}:3000" environment: NEXT_PUBLIC_API_URL: http://localhost:${API_PORT:-8000} depends_on: - api volumes: pgdata: