Ajay Singh Rathore
commited on
Commit
·
afd0d29
1
Parent(s):
f4d994b
fix: Set directory permissions for cache
Browse files- Dockerfile +3 -4
Dockerfile
CHANGED
|
@@ -4,13 +4,12 @@ FROM python:3.9-buster
|
|
| 4 |
# Set the working directory in the container
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# NEW: Change ownership of the app directory to the default user.
|
| 8 |
-
# This gives the application permission to write to this folder.
|
| 9 |
-
RUN chown -R user:user /app
|
| 10 |
-
|
| 11 |
# Set an environment variable to tell Hugging Face where to cache models
|
| 12 |
ENV HF_HOME /app/cache
|
| 13 |
|
|
|
|
|
|
|
|
|
|
| 14 |
# Copy and install the Python dependencies
|
| 15 |
COPY requirements.txt .
|
| 16 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 4 |
# Set the working directory in the container
|
| 5 |
WORKDIR /app
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
# Set an environment variable to tell Hugging Face where to cache models
|
| 8 |
ENV HF_HOME /app/cache
|
| 9 |
|
| 10 |
+
# NEW: Create the cache directory and make it writable by any user
|
| 11 |
+
RUN mkdir -p /app/cache && chmod -R 777 /app/cache
|
| 12 |
+
|
| 13 |
# Copy and install the Python dependencies
|
| 14 |
COPY requirements.txt .
|
| 15 |
RUN pip install --no-cache-dir -r requirements.txt
|