File size: 830 Bytes
6bfe886
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
version: '3.8'

services:
  backend:
    build: .
    ports:
      - "8000:8000"
    environment:
      - USE_EXTREME_OPTIMIZATION=true
      - MAX_MEMORY_GB=3
      - PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:256
      - OMP_NUM_THREADS=2
    volumes:
      - model_cache:/root/.cache/huggingface
      - ./logs:/app/backend/logs
    deploy:
      resources:
        limits:
          memory: 3G
        reservations:
          memory: 2G
    restart: unless-stopped

  frontend:
    image: node:18-alpine
    working_dir: /app
    volumes:
      - ./frontend:/app
    command: sh -c "npm install && npm run build && npm run preview -- --host 0.0.0.0 --port 5173"
    ports:
      - "5173:5173"
    environment:
      - VITE_API_URL=http://localhost:8000
    depends_on:
      - backend

volumes:
  model_cache:
    driver: local