Update Dockerfile
Browse files- Dockerfile +3 -6
Dockerfile
CHANGED
@@ -1,5 +1,3 @@
|
|
1 |
-
# Dockerfile
|
2 |
-
|
3 |
FROM python:3.9
|
4 |
|
5 |
# Create a working directory
|
@@ -13,14 +11,13 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
13 |
COPY . .
|
14 |
|
15 |
############################################
|
16 |
-
#
|
17 |
ENV HF_HOME=/app/.cache/huggingface
|
18 |
ENV TRANSFORMERS_CACHE=/app/.cache/huggingface
|
19 |
ENV TORCH_HOME=/app/.cache/torch
|
20 |
|
21 |
-
#
|
22 |
-
RUN mkdir -p /app/.cache/huggingface
|
23 |
-
RUN mkdir -p /app/.cache/torch
|
24 |
|
25 |
# Expose port 7860 for HF Spaces
|
26 |
EXPOSE 7860
|
|
|
|
|
|
|
1 |
FROM python:3.9
|
2 |
|
3 |
# Create a working directory
|
|
|
11 |
COPY . .
|
12 |
|
13 |
############################################
|
14 |
+
# Set environment variables to use a custom cache location
|
15 |
ENV HF_HOME=/app/.cache/huggingface
|
16 |
ENV TRANSFORMERS_CACHE=/app/.cache/huggingface
|
17 |
ENV TORCH_HOME=/app/.cache/torch
|
18 |
|
19 |
+
# Create the cache directories and set permissions so they are writable.
|
20 |
+
RUN mkdir -p /app/.cache/huggingface && mkdir -p /app/.cache/torch && chmod -R 777 /app/.cache
|
|
|
21 |
|
22 |
# Expose port 7860 for HF Spaces
|
23 |
EXPOSE 7860
|