Update Dockerfile
Browse files- Dockerfile +11 -5
Dockerfile
CHANGED
@@ -2,20 +2,26 @@ FROM python:3.9-slim
|
|
2 |
|
3 |
WORKDIR /code
|
4 |
|
5 |
-
#
|
6 |
-
RUN mkdir -p /tmp/huggingface_cache /tmp/model_cache /tmp/uploads \
|
7 |
-
&& chmod 777 /tmp/huggingface_cache /tmp/model_cache /tmp/uploads
|
8 |
-
|
9 |
RUN apt-get update && \
|
10 |
apt-get install -y --no-install-recommends \
|
11 |
build-essential \
|
12 |
python3-dev \
|
13 |
-
pandoc \
|
14 |
&& rm -rf /var/lib/apt/lists/*
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
COPY requirements.txt .
|
17 |
RUN pip install --no-cache-dir -r requirements.txt
|
18 |
|
|
|
19 |
COPY . .
|
20 |
|
21 |
EXPOSE 7860
|
|
|
2 |
|
3 |
WORKDIR /code
|
4 |
|
5 |
+
# Install system dependencies
|
|
|
|
|
|
|
6 |
RUN apt-get update && \
|
7 |
apt-get install -y --no-install-recommends \
|
8 |
build-essential \
|
9 |
python3-dev \
|
|
|
10 |
&& rm -rf /var/lib/apt/lists/*
|
11 |
|
12 |
+
# Create cache directories and set permissions
|
13 |
+
RUN mkdir -p /tmp/transformers_cache \
|
14 |
+
/tmp/hf_home \
|
15 |
+
/tmp/cache \
|
16 |
+
/tmp/datasets_cache \
|
17 |
+
/tmp/uploads && \
|
18 |
+
chmod -R 777 /tmp
|
19 |
+
|
20 |
+
# Copy requirements first for better caching
|
21 |
COPY requirements.txt .
|
22 |
RUN pip install --no-cache-dir -r requirements.txt
|
23 |
|
24 |
+
# Copy the rest of the application
|
25 |
COPY . .
|
26 |
|
27 |
EXPOSE 7860
|