services: # ===================== # PostgreSQL Database # ===================== postgres: image: postgres:15-alpine container_name: quzuu-postgres restart: unless-stopped environment: POSTGRES_USER: ${POSTGRES_USER:-quzuu} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-quzuu} POSTGRES_DB: ${POSTGRES_DB:-quzuu} volumes: - postgres_data:/var/lib/postgresql/data # Init script: buat roles yang dibutuhkan supabase/storage-api - ./docker/postgres/init-supabase-roles.sql:/docker-entrypoint-initdb.d/01-init-supabase-roles.sql ports: - "5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-quzuu} -d ${POSTGRES_DB:-quzuu}"] interval: 5s timeout: 5s retries: 10 # ===================== # Supabase Storage API (Self-Hosted) # ===================== storage: image: supabase/storage-api:latest container_name: quzuu-storage restart: unless-stopped depends_on: postgres: condition: service_healthy environment: ANON_KEY: ${ANON_KEY} SERVICE_KEY: ${SERVICE_KEY} JWT_SECRET: ${JWT_SECRET} DATABASE_URL: ${DATABASE_URL:-postgres://quzuu:quzuu@postgres:5432/quzuu} DB_INSTALL_ROLES: "false" STORAGE_BACKEND: ${STORAGE_BACKEND:-file} FILE_STORAGE_BACKEND_PATH: ${FILE_STORAGE_BACKEND_PATH:-/var/lib/storage} IS_MULTITENANT: "false" TENANT_ID: stub PGRST_JWT_SECRET: ${PGRST_JWT_SECRET} volumes: - storage_data:/var/lib/storage ports: - "5000:5000" healthcheck: test: ["CMD-SHELL", "node -e \"require('http').get('http://localhost:5000/health', r => process.exit(r.statusCode < 500 ? 0 : 1)).on('error', () => process.exit(1))\""] interval: 10s timeout: 10s retries: 10 start_period: 15s # ===================== # Go Backend App # ===================== app: build: context: . dockerfile: Dockerfile container_name: quzuu-app restart: unless-stopped depends_on: postgres: condition: service_healthy storage: condition: service_healthy env_file: - .env.local ports: - "${HOST_PORT:-8080}:8080" volumes: # Mount logs directory agar bisa diakses dari host - ./logs:/app/logs volumes: postgres_data: driver: local storage_data: driver: local