huy00001 commited on
Commit
5f5d827
·
verified ·
1 Parent(s): e0c5ed8

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +49 -0
Dockerfile ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Base image Python 3.10 slim
2
+ FROM python:3.10-slim
3
+
4
+ # -------------------------
5
+ # 1. Cài thư viện hệ thống
6
+ # -------------------------
7
+ RUN apt-get update && apt-get install -y \
8
+ git \
9
+ git-lfs \
10
+ ffmpeg \
11
+ libsm6 \
12
+ libxext6 \
13
+ libgl1 \
14
+ cmake \
15
+ curl \
16
+ && rm -rf /var/lib/apt/lists/* \
17
+ && git lfs install
18
+
19
+ # -------------------------
20
+ # 2. Thiết lập working directory
21
+ # -------------------------
22
+ WORKDIR /app
23
+
24
+ # -------------------------
25
+ # 3. Copy requirements.txt vào
26
+ # -------------------------
27
+ COPY requirements.txt .
28
+
29
+ # -------------------------
30
+ # 4. Upgrade pip và cài Python packages
31
+ # -------------------------
32
+ RUN pip install --no-cache-dir --upgrade pip
33
+ RUN pip install --no-cache-dir -r requirements.txt
34
+
35
+ # -------------------------
36
+ # 5. Copy toàn bộ source code
37
+ # -------------------------
38
+ COPY . .
39
+
40
+ # -------------------------
41
+ # 6. Expose port mặc định HF Space
42
+ # -------------------------
43
+ EXPOSE 7860
44
+
45
+ # -------------------------
46
+ # 7. Chạy Flask app
47
+ # -------------------------
48
+ # HF Spaces yêu cầu chạy trên 0.0.0.0 và port $PORT
49
+ CMD ["python", "app.py"]