ManTea commited on
Commit
977d066
·
1 Parent(s): 60531e4
Files changed (1) hide show
  1. Dockerfile +5 -13
Dockerfile CHANGED
@@ -1,23 +1,18 @@
1
  # ---- Base Python ----
2
- FROM python:3.11-slim # (nên dùng 3.11/3.12; nếu buộc 3.9 thì thay lại)
3
 
4
  ENV PYTHONDONTWRITEBYTECODE=1 \
5
  PYTHONUNBUFFERED=1
6
 
7
  WORKDIR /app
8
 
9
- # ---- System deps (gọn, không recommends) ----
10
  RUN apt-get update && apt-get install -y --no-install-recommends \
11
  build-essential \
12
  curl \
13
  git \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
- # (tuỳ app: nếu cần xử lý ảnh/video, mở thêm:)
17
- # RUN apt-get update && apt-get install -y --no-install-recommends \
18
- # ffmpeg libsm6 libxext6 libgl1 \
19
- # && rm -rf /var/lib/apt/lists/*
20
-
21
  # ---- Python deps ----
22
  COPY requirements.txt .
23
  RUN pip install --upgrade pip \
@@ -26,11 +21,8 @@ RUN pip install --upgrade pip \
26
  # ---- App code ----
27
  COPY . .
28
 
29
- # ---- Streamlit config ----
30
- # Dùng PORT do môi trường cung cấp (HF Spaces hoặc PaaS khác)
31
- EXPOSE 7860
32
- HEALTHCHECK CMD curl --fail http://localhost:${PORT:-7860}/_stcore/health || exit 1
33
-
34
- # Chạy với $PORT nếu có, mặc định 7860 khi chạy local
35
  ENV PORT=7860
 
 
36
  ENTRYPOINT ["sh", "-c", "streamlit run main.py --server.address=0.0.0.0 --server.port=${PORT}"]
 
1
  # ---- Base Python ----
2
+ FROM python:3.11-slim
3
 
4
  ENV PYTHONDONTWRITEBYTECODE=1 \
5
  PYTHONUNBUFFERED=1
6
 
7
  WORKDIR /app
8
 
9
+ # ---- System deps ----
10
  RUN apt-get update && apt-get install -y --no-install-recommends \
11
  build-essential \
12
  curl \
13
  git \
14
  && rm -rf /var/lib/apt/lists/*
15
 
 
 
 
 
 
16
  # ---- Python deps ----
17
  COPY requirements.txt .
18
  RUN pip install --upgrade pip \
 
21
  # ---- App code ----
22
  COPY . .
23
 
24
+ # ---- Streamlit run ----
 
 
 
 
 
25
  ENV PORT=7860
26
+ EXPOSE 7860
27
+ HEALTHCHECK CMD curl --fail http://localhost:${PORT}/_stcore/health || exit 1
28
  ENTRYPOINT ["sh", "-c", "streamlit run main.py --server.address=0.0.0.0 --server.port=${PORT}"]