File size: 1,134 Bytes
696e02a
5f5d827
 
 
696e02a
5f5d827
 
 
 
 
 
 
 
 
 
 
 
 
 
696e02a
5f5d827
 
 
 
696e02a
5f5d827
 
 
 
696e02a
5f5d827
 
 
 
 
696e02a
5f5d827
 
 
 
696e02a
5f5d827
 
 
 
696e02a
e065bff
696e02a
e065bff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Base image Python 3.10 slim
FROM python:3.10-slim

# -------------------------
# 1. Cài thư viện hệ thống
# -------------------------
RUN apt-get update && apt-get install -y \
    git \
    git-lfs \
    ffmpeg \
    libsm6 \
    libxext6 \
    libgl1 \
    cmake \
    curl \
    && rm -rf /var/lib/apt/lists/* \
    && git lfs install

# -------------------------
# 2. Thiết lập working directory
# -------------------------
WORKDIR /app

# -------------------------
# 3. Copy requirements.txt vào
# -------------------------
COPY requirements.txt .

# -------------------------
# 4. Upgrade pip và cài Python packages
# -------------------------
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt

# -------------------------
# 5. Copy toàn bộ source code
# -------------------------
COPY . .

# -------------------------
# 6. Expose port mặc định HF Space
# -------------------------
EXPOSE 7860

# -------------------------
# 7. Chạy Flask app
# -------------------------
# HF Spaces yêu cầu chạy trên 0.0.0.0 và port $PORT
CMD ["python", "app.py"]