Update Dockerfile
Browse files- Dockerfile +7 -2
Dockerfile
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
FROM python:3.9
|
2 |
|
3 |
-
# Set
|
4 |
-
ENV
|
|
|
5 |
|
6 |
WORKDIR /code
|
7 |
|
@@ -11,4 +12,8 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
|
11 |
|
12 |
COPY . .
|
13 |
|
|
|
|
|
|
|
|
|
14 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
FROM python:3.9
|
2 |
|
3 |
+
# Set HF_HOME environment variable to specify cache directory
|
4 |
+
ENV HF_HOME=/code/.cache/huggingface
|
5 |
+
|
6 |
|
7 |
WORKDIR /code
|
8 |
|
|
|
12 |
|
13 |
COPY . .
|
14 |
|
15 |
+
# Set permissions for cache directory
|
16 |
+
RUN mkdir -p /code/.cache/huggingface/transformers \
|
17 |
+
&& chmod -R 777 /code/.cache/huggingface
|
18 |
+
|
19 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|