nightey3s/profanity-detection
3
1version: '3.8'2 3services:4 # Main service configuration - automatically uses GPU if available5 profanity-detector:6 build:7 context: .8 dockerfile: Dockerfile9 ports:10 - "7860:7860"11 volumes:12 - huggingface-cache:/root/.cache/huggingface13 - ./:/app # Mount current directory for development14 environment:15 - KMP_DUPLICATE_LIB_OK=TRUE16 command: python profanity_detector.py17 deploy:18 resources:19 reservations:20 devices:21 - driver: nvidia22 count: 123 capabilities: [gpu]24 restart: unless-stopped25 26 # Explicit CPU-only configuration for when GPU causes issues27 profanity-detector-cpu:28 build:29 context: .30 dockerfile: Dockerfile31 ports:32 - "7860:7860"33 volumes:34 - huggingface-cache:/root/.cache/huggingface35 - ./:/app # Mount current directory for development36 environment:37 - KMP_DUPLICATE_LIB_OK=TRUE38 - CUDA_VISIBLE_DEVICES=-1 # Disable CUDA39 command: python profanity_detector.py40 profiles:41 - cpu-only42 restart: unless-stopped43 44volumes:45 huggingface-cache: