Spaces:
Sleeping
Sleeping
File size: 573 Bytes
c7449c9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | version: '3'
services:
book-detection-api:
build:
context: .
dockerfile: Dockerfile
ports:
- "7860:7860"
environment:
- TORCH_HOME=/tmp/.torch # Set torch home to a writable location
volumes:
- model_cache:/tmp/.torch # Persist model cache between restarts
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:7860/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s # Give enough time for model download on first run
volumes:
model_cache: # Named volume for model cache
|