version: '3.8' services: # Inference Service - Main API inference-service: build: context: . dockerfile: docker/Dockerfile.inference container_name: turkish-llm-inference ports: - "8000:8000" environment: - PYTHONPATH=/app - LOG_LEVEL=INFO - MODEL_CONFIG_PATH=/app/configs/model_config.json - ADAPTERS_PATH=/app/adapters - CACHE_DIR=/app/cache - CUDA_VISIBLE_DEVICES=0 volumes: - ./configs:/app/configs:ro - ./adapters:/app/adapters:ro - ./cache:/app/cache - ./logs:/app/logs - model-cache:/root/.cache/huggingface networks: - turkish-llm-network depends_on: - redis deploy: resources: reservations: devices: - driver: nvidia count: 1 capabilities: [gpu] restart: unless-stopped healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/health"] interval: 30s timeout: 10s retries: 3 start_period: 60s # Voice Orchestrator Service voice-service: build: context: . dockerfile: docker/Dockerfile.voice container_name: turkish-llm-voice ports: - "8001:8001" environment: - PYTHONPATH=/app - LOG_LEVEL=INFO - INFERENCE_SERVICE_URL=http://inference-service:8000 - REDIS_URL=redis://redis:6379 volumes: - ./logs:/app/logs - ./cache:/app/cache networks: - turkish-llm-network depends_on: - inference-service - redis restart: unless-stopped healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8001/health"] interval: 30s timeout: 10s retries: 3 start_period: 30s # React Frontend frontend: build: context: ./ui dockerfile: ../docker/Dockerfile.ui container_name: turkish-llm-frontend ports: - "3000:3000" environment: - REACT_APP_API_URL=http://localhost:8000 - REACT_APP_WS_URL=ws://localhost:8001 - NODE_ENV=production networks: - turkish-llm-network depends_on: - inference-service - voice-service restart: unless-stopped healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3000"] interval: 30s timeout: 10s retries: 3 start_period: 30s # Redis for caching and session management redis: image: redis:7-alpine container_name: turkish-llm-redis ports: - "6379:6379" volumes: - redis-data:/data - ./docker/redis.conf:/usr/local/etc/redis/redis.conf:ro command: redis-server /usr/local/etc/redis/redis.conf networks: - turkish-llm-network restart: unless-stopped healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 3 # Nginx Reverse Proxy nginx: image: nginx:alpine container_name: turkish-llm-nginx ports: - "80:80" - "443:443" volumes: - ./docker/nginx.conf:/etc/nginx/nginx.conf:ro - ./docker/ssl:/etc/nginx/ssl:ro - nginx-logs:/var/log/nginx networks: - turkish-llm-network depends_on: - frontend - inference-service - voice-service restart: unless-stopped healthcheck: test: ["CMD", "curl", "-f", "http://localhost/health"] interval: 30s timeout: 10s retries: 3 # Monitoring with Prometheus prometheus: image: prom/prometheus:latest container_name: turkish-llm-prometheus ports: - "9090:9090" volumes: - ./docker/prometheus.yml:/etc/prometheus/prometheus.yml:ro - 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=200h' - '--web.enable-lifecycle' networks: - turkish-llm-network restart: unless-stopped # Grafana for visualization grafana: image: grafana/grafana:latest container_name: turkish-llm-grafana ports: - "3001:3000" environment: - GF_SECURITY_ADMIN_PASSWORD=admin123 - GF_USERS_ALLOW_SIGN_UP=false volumes: - grafana-data:/var/lib/grafana - ./docker/grafana/dashboards:/etc/grafana/provisioning/dashboards:ro - ./docker/grafana/datasources:/etc/grafana/provisioning/datasources:ro networks: - turkish-llm-network depends_on: - prometheus restart: unless-stopped # PostgreSQL for persistent data postgres: image: postgres:15-alpine container_name: turkish-llm-postgres ports: - "5432:5432" environment: - POSTGRES_DB=turkish_llm - POSTGRES_USER=turkish_llm_user - POSTGRES_PASSWORD=secure_password_123 volumes: - postgres-data:/var/lib/postgresql/data - ./docker/init.sql:/docker-entrypoint-initdb.d/init.sql:ro networks: - turkish-llm-network restart: unless-stopped healthcheck: test: ["CMD-SHELL", "pg_isready -U turkish_llm_user -d turkish_llm"] interval: 10s timeout: 5s retries: 3 # Training Service (optional, for scheduled training) training-service: build: context: . dockerfile: docker/Dockerfile.training container_name: turkish-llm-training environment: - PYTHONPATH=/app - LOG_LEVEL=INFO - CUDA_VISIBLE_DEVICES=0 - POSTGRES_URL=postgresql://turkish_llm_user:secure_password_123@postgres:5432/turkish_llm volumes: - ./datasets:/app/datasets - ./adapters:/app/adapters - ./configs:/app/configs:ro - ./logs:/app/logs - model-cache:/root/.cache/huggingface networks: - turkish-llm-network depends_on: - postgres deploy: resources: reservations: devices: - driver: nvidia count: 1 capabilities: [gpu] restart: "no" # Only run when explicitly started profiles: - training # Only start with --profile training networks: turkish-llm-network: driver: bridge ipam: config: - subnet: 172.20.0.0/16 volumes: model-cache: driver: local redis-data: driver: local prometheus-data: driver: local grafana-data: driver: local postgres-data: driver: local nginx-logs: driver: local