version: '3.8' services: # Main application with GPU support backgroundfx-gpu: build: context: .. dockerfile: docker/Dockerfile image: backgroundfx-pro:gpu container_name: backgroundfx-gpu runtime: nvidia environment: - NVIDIA_VISIBLE_DEVICES=0 - CUDA_VISIBLE_DEVICES=0 - GRADIO_SERVER_NAME=0.0.0.0 - GRADIO_SERVER_PORT=7860 - MODEL_CACHE_DIR=/app/models - TORCH_HOME=/app/models/.cache - LOG_LEVEL=INFO - MAX_WORKERS=4 volumes: - model-cache:/app/models - uploads:/app/uploads - outputs:/app/outputs - ./config:/app/config:ro ports: - "7860:7860" # Gradio UI - "8000:8000" # REST API networks: - backgroundfx-net healthcheck: test: ["CMD", "curl", "-f", "http://localhost:7860/health"] interval: 30s timeout: 10s retries: 3 start_period: 60s deploy: resources: reservations: devices: - driver: nvidia count: 1 capabilities: [gpu] limits: memory: 16G cpus: '8' restart: