Spaces:
Paused
Paused
chore(docker): create /data dirs and chown for model/cache; set OMP_NUM_THREADS=1
Browse files- Dockerfile +6 -1
Dockerfile
CHANGED
|
@@ -12,7 +12,8 @@ ENV HF_HUB_ENABLE_HF_TRANSFER=1 \
|
|
| 12 |
HUGGINGFACE_HUB_CACHE=/data/.cache/huggingface \
|
| 13 |
HF_HOME=/data/.cache/huggingface \
|
| 14 |
DOTS_OCR_LOCAL_DIR=/data/models/dots-ocr \
|
| 15 |
-
PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb=512
|
|
|
|
| 16 |
|
| 17 |
# Install system dependencies as root
|
| 18 |
RUN apt-get update && apt-get install -y \
|
|
@@ -39,6 +40,10 @@ RUN apt-get update && apt-get install -y \
|
|
| 39 |
# Set up a new user named "user" with user ID 1000
|
| 40 |
RUN useradd -m -u 1000 user
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
# Switch to the "user" user
|
| 43 |
USER user
|
| 44 |
|
|
|
|
| 12 |
HUGGINGFACE_HUB_CACHE=/data/.cache/huggingface \
|
| 13 |
HF_HOME=/data/.cache/huggingface \
|
| 14 |
DOTS_OCR_LOCAL_DIR=/data/models/dots-ocr \
|
| 15 |
+
PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb=512 \
|
| 16 |
+
OMP_NUM_THREADS=1
|
| 17 |
|
| 18 |
# Install system dependencies as root
|
| 19 |
RUN apt-get update && apt-get install -y \
|
|
|
|
| 40 |
# Set up a new user named "user" with user ID 1000
|
| 41 |
RUN useradd -m -u 1000 user
|
| 42 |
|
| 43 |
+
# Create persistent data directories and grant write access to the user
|
| 44 |
+
RUN mkdir -p /data/.cache/huggingface /data/models/dots-ocr && \
|
| 45 |
+
chown -R 1000:1000 /data
|
| 46 |
+
|
| 47 |
# Switch to the "user" user
|
| 48 |
USER user
|
| 49 |
|