Commit
Β·
52506ec
1
Parent(s):
a0121b0
update dockerfile
Browse files- Dockerfile +11 -0
Dockerfile
CHANGED
@@ -8,6 +8,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
8 |
# Set the working directory in the container
|
9 |
WORKDIR /app
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
COPY setup.sh .
|
12 |
COPY requirements.txt .
|
13 |
COPY app.py .
|
|
|
8 |
# Set the working directory in the container
|
9 |
WORKDIR /app
|
10 |
|
11 |
+
# --- Define cache directory early for clarity ---
|
12 |
+
ARG HF_CACHE_DIR_ARG=/app/.cache
|
13 |
+
ENV HF_HOME=${HF_CACHE_DIR_ARG}
|
14 |
+
ENV HF_DATASETS_CACHE=${HF_CACHE_DIR_ARG}/datasets
|
15 |
+
ENV TRANSFORMERS_CACHE=${HF_CACHE_DIR_ARG}/transformers
|
16 |
+
# Add other HF cache variables if needed (e.g., HUGGINGFACE_HUB_CACHE)
|
17 |
+
|
18 |
+
# Create the cache directories and make them writable
|
19 |
+
# This also creates parent directories like /app/.cache
|
20 |
+
RUN mkdir -p ${HF_DATASETS_CACHE} && chmod -R 777 ${HF_CACHE_DIR_ARG}
|
21 |
+
|
22 |
COPY setup.sh .
|
23 |
COPY requirements.txt .
|
24 |
COPY app.py .
|