J
File size: 843 Bytes
7d6a5e2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
version: "3.9"

services:
  bgremover:
    build: .
    container_name: bgremover_pro
    ports:
      - "7860:7860"
    environment:
      - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
      - U2NET_HOME=/app/models/u2net
      - HF_HOME=/app/models/hf
      - TRANSFORMERS_CACHE=/app/models/transformers
      - OMP_NUM_THREADS=2
      - OPENBLAS_NUM_THREADS=2
    volumes:
      # Persist downloaded models so they survive rebuilds
      - model_cache:/app/models
    restart: unless-stopped
    mem_limit: 14g           # leave 2GB for OS on 16GB host
    cpus: "1.8"              # leave 0.2 for OS on 2vCPU
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:7860/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 120s     # allow time for model loading at startup

volumes:
  model_cache: