services: # ── SentinelAI Backend ───────────────────────────────────────────────────── gateway: build: context: . dockerfile: Dockerfile.backend container_name: sentinelai-gateway ports: - "8000:8000" environment: - ENVIRONMENT=production - DEBUG=false - DATABASE_URL=${DATABASE_URL} - REDIS_URL=${REDIS_URL:-redis://redis:6379} - SECRET_KEY=${SECRET_KEY} - OPENAI_API_KEY=${OPENAI_API_KEY:-} - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-} - GOOGLE_API_KEY=${GOOGLE_API_KEY:-} - ALLOWED_ORIGINS_RAW=http://localhost:3000,http://localhost:5173,http://frontend:3000,http://localhost:80 depends_on: postgres: condition: service_healthy redis: condition: service_healthy volumes: - ./logs:/app/logs - ./policies:/app/policies healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/health"] interval: 30s timeout: 10s retries: 3 start_period: 10s restart: unless-stopped networks: - sentinelai # ── React Frontend ───────────────────────────────────────────────────────── frontend: build: context: ./frontend dockerfile: ../Dockerfile.frontend container_name: sentinelai-frontend ports: - "3000:80" environment: - VITE_API_URL=http://localhost:8000 depends_on: - gateway restart: unless-stopped networks: - sentinelai # ── PostgreSQL ───────────────────────────────────────────────────────────── postgres: image: postgres:16-alpine container_name: sentinelai-postgres environment: POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: ${POSTGRES_DB} volumes: - postgres_data:/var/lib/postgresql/data ports: - "5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"] interval: 10s timeout: 5s retries: 5 restart: unless-stopped networks: - sentinelai # ── Redis ────────────────────────────────────────────────────────────────── redis: image: redis:7-alpine container_name: sentinelai-redis ports: - "6379:6379" command: redis-server --appendonly yes volumes: - redis_data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 restart: unless-stopped networks: - sentinelai # ── Prometheus ───────────────────────────────────────────────────────────── prometheus: image: prom/prometheus:latest container_name: sentinelai-prometheus ports: - "9090:9090" volumes: - ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml - prometheus_data:/prometheus command: - '--config.file=/etc/prometheus/prometheus.yml' - '--storage.tsdb.path=/prometheus' - '--web.console.libraries=/etc/prometheus/console_libraries' - '--web.console.templates=/etc/prometheus/consoles' - '--storage.tsdb.retention.time=30d' restart: unless-stopped networks: - sentinelai # ── Grafana ──────────────────────────────────────────────────────────────── grafana: image: grafana/grafana:latest container_name: sentinelai-grafana ports: - "3001:3000" environment: - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD} - GF_USERS_ALLOW_SIGN_UP=false volumes: - grafana_data:/var/lib/grafana - ./monitoring/grafana/provisioning:/etc/grafana/provisioning depends_on: - prometheus restart: unless-stopped networks: - sentinelai volumes: postgres_data: redis_data: prometheus_data: grafana_data: networks: sentinelai: driver: bridge