Fix permission issues - create writable cache directories for HF models
Browse files- Dockerfile +9 -0
Dockerfile
CHANGED
|
@@ -30,6 +30,15 @@ RUN apt-get update && apt-get install -y \
|
|
| 30 |
# Set working directory
|
| 31 |
WORKDIR /app
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
# Copy requirements and install Python packages
|
| 34 |
COPY requirements.txt .
|
| 35 |
|
|
|
|
| 30 |
# Set working directory
|
| 31 |
WORKDIR /app
|
| 32 |
|
| 33 |
+
# Create writable directories for Hugging Face cache
|
| 34 |
+
RUN mkdir -p /app/.cache /app/.config && \
|
| 35 |
+
chmod 777 /app/.cache /app/.config
|
| 36 |
+
|
| 37 |
+
# Set environment variables for Hugging Face
|
| 38 |
+
ENV HF_HOME=/app/.cache
|
| 39 |
+
ENV TRANSFORMERS_CACHE=/app/.cache
|
| 40 |
+
ENV YOLO_CONFIG_DIR=/app/.config
|
| 41 |
+
|
| 42 |
# Copy requirements and install Python packages
|
| 43 |
COPY requirements.txt .
|
| 44 |
|