neyugntuan commited on
Commit
4fec0a8
·
verified ·
1 Parent(s): 4907a49

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -0
Dockerfile ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Cài dependency hệ thống cần cho underthesea & numpy
6
+ RUN apt-get update && apt-get install -y \
7
+ build-essential \
8
+ libgomp1 \
9
+ wget \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Copy requirements rồi cài
13
+ COPY requirements.txt /app/
14
+ RUN pip install --no-cache-dir -r requirements.txt
15
+
16
+ # Copy toàn bộ code
17
+ COPY . /app/
18
+
19
+ # Expose cổng FastAPI
20
+ EXPOSE 8000
21
+
22
+ # Chạy API bằng uvicorn
23
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]