version: '3.8' services: # PostgreSQL database postgres: image: postgres:16-alpine container_name: chat-switchboard-db environment: POSTGRES_USER: switchboard POSTGRES_PASSWORD: ${DB_PASSWORD:-switchboard_dev} POSTGRES_DB: chat_switchboard volumes: - postgres_data:/var/lib/postgresql/data ports: - "5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U switchboard -d chat_switchboard"] interval: 5s timeout: 5s retries: 5 # Chat Switchboard (unified: Go backend + nginx frontend) switchboard: build: context: . dockerfile: Dockerfile container_name: chat-switchboard environment: PORT: "8080" BASE_PATH: "" POSTGRES_HOST: postgres POSTGRES_PORT: "5432" POSTGRES_USER: switchboard POSTGRES_PASSWORD: ${DB_PASSWORD:-switchboard_dev} POSTGRES_DB: chat_switchboard POSTGRES_SSLMODE: disable JWT_SECRET: ${JWT_SECRET:-change-me-in-production} SWITCHBOARD_ADMIN_USERNAME: ${ADMIN_USERNAME:-admin} SWITCHBOARD_ADMIN_PASSWORD: ${ADMIN_PASSWORD:-admin} # File storage — mount ./data/storage on host STORAGE_PATH: /data/storage volumes: - switchboard_storage:/data/storage ports: - "3000:80" depends_on: postgres: condition: service_healthy # Adminer for database management (optional, dev only) adminer: image: adminer:latest container_name: chat-switchboard-adminer ports: - "8081:8080" depends_on: - postgres profiles: - dev volumes: postgres_data: switchboard_storage: