File size: 1,138 Bytes
80f71e5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
version: '3.8'

services:
  # Main service configuration - automatically uses GPU if available
  profanity-detector:
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "7860:7860"
    volumes:
      - huggingface-cache:/root/.cache/huggingface
      - ./:/app  # Mount current directory for development
    environment:
      - KMP_DUPLICATE_LIB_OK=TRUE
    command: python profanity_detector.py
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    restart: unless-stopped
  
  # Explicit CPU-only configuration for when GPU causes issues
  profanity-detector-cpu:
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "7860:7860"
    volumes:
      - huggingface-cache:/root/.cache/huggingface
      - ./:/app  # Mount current directory for development
    environment:
      - KMP_DUPLICATE_LIB_OK=TRUE
      - CUDA_VISIBLE_DEVICES=-1  # Disable CUDA
    command: python profanity_detector.py
    profiles:
      - cpu-only
    restart: unless-stopped

volumes:
  huggingface-cache: