version: '3.8' services: # PostgreSQL Database postgres: image: postgres:15-alpine environment: POSTGRES_DB: sentinelx POSTGRES_USER: sentinelx POSTGRES_PASSWORD: password volumes: - postgres_data:/var/lib/postgresql/data ports: - "5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U sentinelx -d sentinelx"] interval: 10s timeout: 5s retries: 5 # Redis Cache redis: image: redis:7-alpine ports: - "6379:6379" volumes: - redis_data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 # Backend API backend: build: context: ./backend dockerfile: Dockerfile environment: DATABASE_URL: postgresql://sentinelx:password@postgres:5432/sentinelx REDIS_URL: redis://redis:6379 JWT_SECRET_KEY: demo-secret-key-change-in-production ports: - "8000:8000" depends_on: postgres: condition: service_healthy redis: condition: service_healthy volumes: - ./backend:/app command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload # Frontend frontend: build: context: ./frontend dockerfile: Dockerfile ports: - "3000:3000" depends_on: - backend volumes: - ./frontend:/app - /app/node_modules environment: VITE_API_URL: http://localhost:8000 volumes: postgres_data: redis_data: