Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +6 -1
Dockerfile
CHANGED
@@ -4,6 +4,11 @@ FROM python:3.9-slim
|
|
4 |
# Set the working directory in the container
|
5 |
WORKDIR /code
|
6 |
|
|
|
|
|
|
|
|
|
|
|
7 |
# Copy the dependencies file to the working directory
|
8 |
COPY ./requirements.txt /code/requirements.txt
|
9 |
|
@@ -14,4 +19,4 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
|
14 |
COPY . /code/
|
15 |
|
16 |
# Command to run the application
|
17 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
4 |
# Set the working directory in the container
|
5 |
WORKDIR /code
|
6 |
|
7 |
+
# --- FIX ---
|
8 |
+
# Set an environment variable to tell transformers to use a local cache directory
|
9 |
+
# This prevents the PermissionError by saving models inside the allowed /code folder.
|
10 |
+
ENV TRANSFORMERS_CACHE="/code/.cache"
|
11 |
+
|
12 |
# Copy the dependencies file to the working directory
|
13 |
COPY ./requirements.txt /code/requirements.txt
|
14 |
|
|
|
19 |
COPY . /code/
|
20 |
|
21 |
# Command to run the application
|
22 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|