Spaces:
Sleeping
Sleeping
Add application file
Browse files- Dockerfile +16 -3
Dockerfile
CHANGED
@@ -2,6 +2,22 @@ FROM python:3.9-slim
|
|
2 |
|
3 |
WORKDIR /app
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
# Copy requirements first for better caching
|
6 |
COPY requirements.txt .
|
7 |
|
@@ -11,9 +27,6 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
11 |
# Copy the rest of the application
|
12 |
COPY . .
|
13 |
|
14 |
-
# Create data directory
|
15 |
-
RUN mkdir -p data
|
16 |
-
|
17 |
# Expose the port that the app will run on
|
18 |
EXPOSE 7860
|
19 |
|
|
|
2 |
|
3 |
WORKDIR /app
|
4 |
|
5 |
+
# Cài đặt các dependencies cần thiết
|
6 |
+
RUN apt-get update && apt-get install -y \
|
7 |
+
build-essential \
|
8 |
+
git \
|
9 |
+
&& rm -rf /var/lib/apt/lists/*
|
10 |
+
|
11 |
+
# Tạo các thư mục cần thiết và cấp quyền
|
12 |
+
RUN mkdir -p /tmp/matplotlib-cache /tmp/huggingface-cache && \
|
13 |
+
chmod 777 /tmp/matplotlib-cache /tmp/huggingface-cache
|
14 |
+
|
15 |
+
# Thiết lập biến môi trường cho Matplotlib và Hugging Face
|
16 |
+
ENV MPLCONFIGDIR=/tmp/matplotlib-cache
|
17 |
+
ENV TRANSFORMERS_CACHE=/tmp/huggingface-cache
|
18 |
+
ENV HF_HOME=/tmp/huggingface-cache
|
19 |
+
ENV HF_DATASETS_CACHE=/tmp/huggingface-cache
|
20 |
+
|
21 |
# Copy requirements first for better caching
|
22 |
COPY requirements.txt .
|
23 |
|
|
|
27 |
# Copy the rest of the application
|
28 |
COPY . .
|
29 |
|
|
|
|
|
|
|
30 |
# Expose the port that the app will run on
|
31 |
EXPOSE 7860
|
32 |
|