# Production Docker Compose # 1. Set a database password: export POSTGRES_PASSWORD=$(openssl rand -hex 24) # (or put POSTGRES_PASSWORD=... in a .env file next to this compose file) # 2. Run: docker-compose -f docker-compose.prod.yml up -d # 3. Visit: http://localhost:8000/admin to configure services: postgres: image: postgres:17-alpine environment: POSTGRES_USER: polar POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD (e.g. export POSTGRES_PASSWORD=$(openssl rand -hex 24))} POSTGRES_DB: polar volumes: - postgres-data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U polar"] interval: 5s timeout: 5s retries: 5 restart: unless-stopped polar-flow-server: image: stumason/polar-flow-server:latest depends_on: postgres: condition: service_healthy environment: DATABASE_URL: postgresql+asyncpg://polar:${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD}@postgres:5432/polar volumes: # Persists auto-generated encryption/session keys (KEY_DIR=/data/keys). # Without this, every recreate regenerates the encryption key and all # stored Polar tokens become permanently undecryptable. - app-data:/data ports: - "8000:8000" healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/health"] interval: 30s timeout: 10s retries: 3 start_period: 40s restart: unless-stopped volumes: postgres-data: app-data: