Update OCR service command in docker-compose.yml to use pipeline configuration file

- Modified the OCR service command to check for the existence of the pipeline configuration file and download it if not present, enhancing the setup process.
- Added a volume mount for the paddlex directory to ensure access to necessary files during execution.
This commit is contained in:
Yury Kossakovsky
2025-08-29 18:13:24 -06:00
parent 34668fb817
commit b827f38d23

View File

@@ -758,11 +758,15 @@ services:
python -m pip install --upgrade pip; \
python -m pip install --no-cache-dir 'paddlex[ocr]'; \
python -m paddlex --install serving; \
exec python -m paddlex --serve --pipeline OCR --device cpu --port 8080"
if [ ! -f /app/PP-ChatOCRv3-doc.yaml ]; then \
python -m paddlex --get_pipeline_config PP-ChatOCRv3-doc --save_path /app; \
fi; \
exec python -m paddlex --serve --pipeline /app/PP-ChatOCRv3-doc.yaml --device cpu --port 8080"
volumes:
- paddleocr_cache:/root/.paddleocr
- paddle_cache:/root/.cache/paddle
- paddlex_data:/root/.paddlex
- ./paddlex:/app
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:8080 > /dev/null || exit 1"]
interval: 30s