Spaces:
Running
Running
fix bug
Browse files- Dockerfile +7 -3
Dockerfile
CHANGED
@@ -8,6 +8,13 @@ RUN apt-get update && apt-get install -y \
|
|
8 |
git \
|
9 |
&& rm -rf /var/lib/apt/lists/*
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
# Copy requirements từ project hiện tại
|
12 |
COPY requirements.txt .
|
13 |
|
@@ -22,9 +29,6 @@ RUN --mount=type=secret,id=BITBUCKET_APP_PW,mode=0444,required=true \
|
|
22 |
RUN pip install --no-cache-dir -r requirements.txt
|
23 |
RUN pip install --no-cache-dir -r meisai-check-ai/requirements.txt
|
24 |
|
25 |
-
# Cài đặt FastAPI và Uvicorn
|
26 |
-
RUN pip install --no-cache-dir fastapi uvicorn
|
27 |
-
|
28 |
# Copy code của API vào container
|
29 |
COPY . .
|
30 |
|
|
|
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 /app/data /app/uploads /app/outputs /tmp/matplotlib-cache && \
|
13 |
+
chmod 777 /app/data /app/uploads /app/outputs /tmp/matplotlib-cache
|
14 |
+
|
15 |
+
# Thiết lập biến môi trường cho Matplotlib
|
16 |
+
ENV MPLCONFIGDIR=/tmp/matplotlib-cache
|
17 |
+
|
18 |
# Copy requirements từ project hiện tại
|
19 |
COPY requirements.txt .
|
20 |
|
|
|
29 |
RUN pip install --no-cache-dir -r requirements.txt
|
30 |
RUN pip install --no-cache-dir -r meisai-check-ai/requirements.txt
|
31 |
|
|
|
|
|
|
|
32 |
# Copy code của API vào container
|
33 |
COPY . .
|
34 |
|