Fix RapidOCR model download permission in local image

Grant appuser write access to rapidocr/models directory so OCR
models can be downloaded at runtime.
This commit is contained in:
Pier-Jean Malandrino 2026-04-03 10:44:20 +02:00
parent 48b7d5d3e8
commit 48c5e4ea6b
2 changed files with 4 additions and 2 deletions

View file

@ -73,5 +73,6 @@ COPY document-parser/requirements-local.txt .
RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu \
&& pip install --no-cache-dir -r requirements-local.txt
RUN chown -R appuser:appuser /app
RUN chown -R appuser:appuser /app \
&& chown -R appuser:appuser /usr/local/lib/python3.12/site-packages/rapidocr/models
ENV CONVERSION_ENGINE=local

View file

@ -50,6 +50,7 @@ COPY requirements-local.txt .
RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu \
&& pip install --no-cache-dir -r requirements-local.txt
RUN chown -R appuser:appuser /app
RUN chown -R appuser:appuser /app \
&& chown -R appuser:appuser /usr/local/lib/python3.12/site-packages/rapidocr/models
USER appuser
ENV CONVERSION_ENGINE=local