Spaces:
Running
Running
aaaa
Browse files- Dockerfile +26 -14
Dockerfile
CHANGED
@@ -1,14 +1,26 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
RUN
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.10-slim
|
2 |
+
|
3 |
+
WORKDIR /app
|
4 |
+
|
5 |
+
COPY requirements.txt .
|
6 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
7 |
+
|
8 |
+
COPY . .
|
9 |
+
|
10 |
+
# Cài đặt gdown và underthesea có thể cần thêm dependencies
|
11 |
+
RUN apt-get update && apt-get install -y \
|
12 |
+
build-essential \
|
13 |
+
python3-dev \
|
14 |
+
g++ \
|
15 |
+
libopenblas-dev \
|
16 |
+
libatlas-base-dev \
|
17 |
+
liblapack-dev \
|
18 |
+
libpq-dev \
|
19 |
+
curl \
|
20 |
+
git \
|
21 |
+
&& rm -rf /var/lib/apt/lists/*
|
22 |
+
|
23 |
+
# Pre-download model here (optionally, to avoid load delay in run)
|
24 |
+
# RUN python download_weights.py
|
25 |
+
|
26 |
+
CMD ["gunicorn", "toxic_api:app", "--bind", "0.0.0.0:5000", "--timeout", "120", "--workers", "1", "--preload"]
|