Finalize local deployment config: CPU mode, persistent cache, port 8001

- docker-compose.yml: default TORCH_DEVICE=cpu, PORT=8001, named volumes
  for model cache (marker-cache) and results (marker-results) with :Z flag
- convert_both.py: API_URL defaults to port 8001, overridable via env
- TODO.md: reflect final decisions (iGPU 30x slower than CPU,
  --privileged required for GPU, CPU mode is default)
This commit is contained in:
oval
2026-06-07 23:37:04 +02:00
parent d1658d29b1
commit df8d0d6b74
3 changed files with 42 additions and 42 deletions
+15 -16
View File
@@ -8,36 +8,35 @@ services:
dockerfile: Containerfile
image: marker-api:latest
env_file:
- .env # optional; remove if no .env exists
- .env
environment:
- OLLAMA_HOST=${OLLAMA_HOST:-http://localhost:11435}
- DEESEEK_OCR_MODEL=${DEESEEK_OCR_MODEL:-deepseek-ocr}
- AMD_COMPUTE=${AMD_COMPUTE:-true}
- TORCH_DEVICE=${TORCH_DEVICE:-cuda}
- TORCH_DEVICE=${TORCH_DEVICE:-cpu}
- MODEL_DTYPE=${MODEL_DTYPE:-float32}
- OLLAMA_HOST=${OLLAMA_HOST:-http://localhost:11435}
- DEESEEK_OCR_MODEL=${DEESEEK_OCR_MODEL:-}
- LLM_SERVICE=marker.services.openai.OpenAIService
- USE_LLM=false
- USE_LLM=${USE_LLM:-false}
- OPENAI_BASE_URL=http://localhost:11435/v1
- OPENAI_API_KEY=not-needed
- OPENAI_MODEL=
- PORT=8000
- PORT=${PORT:-8001}
- HOST=0.0.0.0
- GUNICORN_WORKERS=${GUNICORN_WORKERS:-2}
- GUNICORN_THREADS=${GUNICORN_THREADS:-4}
- GUNICORN_TIMEOUT=${GUNICORN_TIMEOUT:-300}
- GUNICORN_WORKERS=${GUNICORN_WORKERS:-1}
- GUNICORN_THREADS=${GUNICORN_THREADS:-2}
- GUNICORN_TIMEOUT=${GUNICORN_TIMEOUT:-600}
ports:
- "8000:8000"
- "${PORT:-8001}:${PORT:-8001}"
volumes:
- /dev/kfd:/dev/kfd
- /dev/dri:/dev/dri
- marker-data:/app/conversion_results
- marker-results:/app/conversion_results:rw,Z
- marker-cache:/app/.cache:rw,Z
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
test: ["CMD", "curl", "-f", "http://localhost:${PORT:-8001}/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 120s
volumes:
marker-data:
marker-results:
marker-cache: