version: '3.8'

services:
  quantumflow:
    build: .
    container_name: quantumflow
    ports:
      - "8000:8000"
    environment:
      - PYTHONUNBUFFERED=1
    volumes:
      - ./backend:/app/backend
      - ./frontend:/app/frontend
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s

  nginx:
    image: nginx:alpine
    container_name: quantumflow-nginx
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./frontend:/usr/share/nginx/html
      - ./deployment/nginx.conf:/etc/nginx/conf.d/default.conf
      - ./deployment/ssl:/etc/nginx/ssl
    depends_on:
      - quantumflow
    restart: unless-stopped

volumes:
  ssl_certs:
    driver: local

networks:
  default:
    name: quantumflow-network
