COPY does not support shell operators (||, 2>/dev/null).
Keep wheels/ for paddlepaddle whl installation.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove VOLUME directive that was creating anonymous volumes
- Keep directory creation (mkdir) for runtime mount points
- Users must explicitly mount volumes with -v flags
- This prevents hidden volume bloat in docker exec
Usage:
docker run --gpus all -p 8053:8053 \
-v /home/yoge/.cache/modelscope:/root/.cache/modelscope:ro \
-v /home/yoge/.cache/huggingface:/root/.cache/huggingface:ro \
-v /home/yoge/.paddlex:/root/.paddlex:ro \
doc_processer:latest
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Use multi-stage build to exclude build dependencies from final image
- Separate builder stage using devel image from runtime stage using smaller base image
- Clean venv: remove __pycache__, .pyc files, and test directories
- Remove embedded model files (243MB) from app/model/ - mount at runtime instead
- Expected size reduction: 18.9GB → 2-3GB (80-90% reduction)
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>