nhanne24 commited on
Commit
80b9fac
·
verified ·
1 Parent(s): 6883932
Files changed (1) hide show
  1. Dockerfile +26 -14
Dockerfile CHANGED
@@ -1,14 +1,26 @@
1
-
2
- FROM python:3.9
3
-
4
- RUN useradd -m -u 1000 user
5
- USER user
6
- ENV PATH="/home/user/.local/bin:$PATH"
7
-
8
- WORKDIR /app
9
-
10
- COPY --chown=user ./requirements.txt requirements.txt
11
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
12
-
13
- COPY --chown=user . /app
14
- CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
 
 
 
 
 
 
 
 
 
 
 
 
 
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"]