File size: 1,323 Bytes
963cb02
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
services:
  span-classifier:
    container_name: span-classifier-app
    build:
      context: .
      dockerfile: Dockerfile
      network: host
    image: 8e6b331d0418
    ports:
      - "7860:7860"
    volumes:
      # Mount model weights directory
      - ./experiments:/app/experiments:ro
      # Mount cache directory for Hugging Face models
      - /home/cthelen/.cache/huggingface:/home/appuser/.cache/huggingface
      # Mount logs directory
      - ./logs:/app/logs
    environment:
      - PYTHONUNBUFFERED=1
      - CUDA_DEVICE_ORDER=PCI_BUS_ID
      - CUDA_VISIBLE_DEVICES=0
      - GRADIO_SERVER_NAME=0.0.0.0
      - GRADIO_SERVER_PORT=7860
      - TRANSFORMERS_CACHE=/home/appuser/.cache/huggingface
      - TORCH_HOME=/home/appuser/.cache/torch
    runtime: nvidia
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    restart: unless-stopped
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.demo.rule=Host(`span-classifier.gpu2.lfi.rwth-aachen.de`)"
      - "traefik.http.routers.demo.tls=true"
      - "traefik.http.routers.demo.tls.certresolver=letsencrypt"
      - "com.centurylinklabs.watchtower.enable=false"
    networks:
      - web

networks:
  web:
    external: true