Waikul commited on
Commit
02d4459
·
verified ·
1 Parent(s): 4c05e80

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -0
Dockerfile ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ # --- libs for OpenCV (สำคัญมาก) ---
4
+ RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ libgl1 \
6
+ libglib2.0-0 \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ WORKDIR /app
10
+
11
+ # ติดตั้งไพธอนแพ็กเกจ
12
+ COPY requirements.txt ./requirements.txt
13
+ RUN pip install --no-cache-dir -r requirements.txt
14
+
15
+ # คัดลอกซอร์สทั้งหมด (server.py, templates/, static/, README.md, LICENSE)
16
+ COPY . .
17
+
18
+ # Hugging Face จะกำหนด $PORT มาให้เอง
19
+ EXPOSE 7860
20
+ CMD ["sh", "-c", "uvicorn server:app --host 0.0.0.0 --port ${PORT:-7860}"]