File size: 1,144 Bytes
d8a526e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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: