Spaces:
Sleeping
Sleeping
Commit ·
29b213f
1
Parent(s): 952ff40
Fix: pre-create EasyOCR cache dirs for non-root user
Browse files- Dockerfile +6 -2
Dockerfile
CHANGED
|
@@ -29,12 +29,16 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 29 |
# ----- Copy application source -----
|
| 30 |
COPY . .
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
# ----- Ensure appuser owns everything -----
|
| 33 |
RUN chown -R appuser:appuser /app
|
| 34 |
|
| 35 |
-
# -----
|
| 36 |
ENV HF_HOME=/app/.cache/huggingface
|
| 37 |
-
|
| 38 |
ENV EASYOCR_MODULE_PATH=/app/.cache/easyocr
|
| 39 |
|
| 40 |
# ----- Switch to non-root user -----
|
|
|
|
| 29 |
# ----- Copy application source -----
|
| 30 |
COPY . .
|
| 31 |
|
| 32 |
+
# ----- Create cache & upload directories -----
|
| 33 |
+
RUN mkdir -p /app/.cache/easyocr/model \
|
| 34 |
+
/app/.cache/huggingface \
|
| 35 |
+
/app/uploads
|
| 36 |
+
|
| 37 |
# ----- Ensure appuser owns everything -----
|
| 38 |
RUN chown -R appuser:appuser /app
|
| 39 |
|
| 40 |
+
# ----- Model cache paths -----
|
| 41 |
ENV HF_HOME=/app/.cache/huggingface
|
|
|
|
| 42 |
ENV EASYOCR_MODULE_PATH=/app/.cache/easyocr
|
| 43 |
|
| 44 |
# ----- Switch to non-root user -----
|