Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +12 -3
Dockerfile
CHANGED
@@ -13,6 +13,17 @@ RUN apt-get update && apt-get install -y \
|
|
13 |
python3-dev \
|
14 |
&& rm -rf /var/lib/apt/lists/*
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
# Upgrade pip
|
17 |
RUN pip install --upgrade pip
|
18 |
|
@@ -26,10 +37,8 @@ COPY . .
|
|
26 |
# Build Cython extensions
|
27 |
RUN cd utils && python setup.py build_ext --inplace
|
28 |
|
29 |
-
# Create necessary directories if they don't exist
|
30 |
RUN mkdir -p data/models && \
|
31 |
-
mkdir -p .cache && \
|
32 |
-
chmod -R 777 .cache && \
|
33 |
chmod -R 777 data
|
34 |
|
35 |
# Expose the port for FastAPI application
|
|
|
13 |
python3-dev \
|
14 |
&& rm -rf /var/lib/apt/lists/*
|
15 |
|
16 |
+
# Create cache directories with proper permissions
|
17 |
+
RUN mkdir -p /app_cache/huggingface \
|
18 |
+
mkdir -p /app_cache/matplotlib \
|
19 |
+
chmod -R 777 /app_cache
|
20 |
+
|
21 |
+
# Set environment variables to use custom cache locations
|
22 |
+
ENV TRANSFORMERS_CACHE=/app_cache/huggingface
|
23 |
+
ENV HF_HOME=/app_cache/huggingface
|
24 |
+
ENV MPLCONFIGDIR=/app_cache/matplotlib
|
25 |
+
ENV TORCH_HOME=/app_cache/torch
|
26 |
+
|
27 |
# Upgrade pip
|
28 |
RUN pip install --upgrade pip
|
29 |
|
|
|
37 |
# Build Cython extensions
|
38 |
RUN cd utils && python setup.py build_ext --inplace
|
39 |
|
40 |
+
# Create necessary directories if they don't exist
|
41 |
RUN mkdir -p data/models && \
|
|
|
|
|
42 |
chmod -R 777 data
|
43 |
|
44 |
# Expose the port for FastAPI application
|