version: '3.8' # Ideas Generator 2025 - Docker Compose Configuration # Production-ready deployment with all services services: # PostgreSQL Database database: image: postgres:15-alpine container_name: ideas-gen-database restart: unless-stopped environment: POSTGRES_DB: ${DATABASE_NAME:-ideas_gen_prod} POSTGRES_USER: ${DATABASE_USER:-ideas_admin} POSTGRES_PASSWORD: ${DATABASE_PASSWORD} POSTGRES_HOST_AUTH_METHOD: ${POSTGRES_HOST_AUTH_METHOD:-scram-sha-256} volumes: - postgres_data:/var/lib/postgresql/data - ./postgres/init.sql:/docker-entrypoint-initdb.d/init.sql:ro networks: - ideas-gen-network healthcheck: test: ["CMD-SHELL", "pg_isready -U ${DATABASE_USER:-ideas_admin} -d ${DATABASE_NAME:-ideas_gen_prod}"] interval: 30s timeout: 10s retries: 3 start_period: 30s # Node.js Backend API backend: build: context: .. dockerfile: docker/Dockerfile.backend container_name: ideas-gen-backend restart: unless-stopped environment: # Database Configuration DATABASE_HOST: database DATABASE_PORT: 5432 DATABASE_NAME: ${DATABASE_NAME:-ideas_gen_prod} DATABASE_USER: ${DATABASE_USER:-ideas_admin} DATABASE_PASSWORD: ${DATABASE_PASSWORD} # Application Configuration NODE_ENV: production PORT: 3000 JWT_SECRET: ${JWT_SECRET} # OpenAI Configuration OPENAI_API_KEY: ${OPENAI_API_KEY} # Azure AD Configuration AZURE_TENANT_ID: ${AZURE_TENANT_ID:-e519c2e6-bc6d-4fdf-8d9c-923c2f002385} AZURE_CLIENT_ID: ${AZURE_CLIENT_ID:-9079054c-9620-4757-a256-23413042f1ef} # Application URLs FRONTEND_URL: ${FRONTEND_URL:-http://localhost} BACKEND_URL: ${BACKEND_URL:-http://localhost/api} # Security CORS_ORIGIN: ${CORS_ORIGIN:-http://localhost,https://localhost} depends_on: database: condition: service_healthy networks: - ideas-gen-network volumes: # Mount logs directory for persistence - backend_logs:/app/logs healthcheck: test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1"] interval: 30s timeout: 10s retries: 3 start_period: 60s # Vue.js Frontend + Nginx frontend: build: context: .. dockerfile: docker/Dockerfile.frontend container_name: ideas-gen-frontend restart: unless-stopped environment: NGINX_HOST: ${DOMAIN_NAME:-localhost} ports: - "${HTTP_PORT:-80}:80" - "${HTTPS_PORT:-443}:443" depends_on: backend: condition: service_healthy networks: - ideas-gen-network volumes: # SSL certificates (if using HTTPS) - "${SSL_CERT_PATH:-./certs}:/etc/nginx/certs:ro" healthcheck: test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:80/health || exit 1"] interval: 30s timeout: 10s retries: 3 start_period: 30s # Named volumes for data persistence volumes: postgres_data: name: ideas-gen-postgres-data backend_logs: name: ideas-gen-backend-logs # Custom network for service communication networks: ideas-gen-network: name: ideas-gen-network driver: bridge