services:
  surya-ocr:
    build: .
    container_name: surya-ocr
    runtime: nvidia
    environment:
      - VLLM_DTYPE=bfloat16
      - VLLM_GPU_TYPE=a100
      - NVIDIA_VISIBLE_DEVICES=all
    ports:
      - "5002:5002"
    volumes:
      - ~/.cache/huggingface:/root/.cache/huggingface
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.surya-ocr.rule=Host(`ocr.kzbrd.ru`)"
      - "traefik.http.routers.surya-ocr.entrypoints=websecure"
      - "traefik.http.routers.surya-ocr.tls.certresolver=myresolver"
      - "traefik.http.services.surya-ocr.loadbalancer.server.port=5002"
    networks:
      - traefik_proxy

networks:
  traefik_proxy:
    external: true
