hoangchihien3011 commited on
Commit
3cfa7ae
·
1 Parent(s): 9e3cbe1
Files changed (2) hide show
  1. Dockerfile +5 -19
  2. requirements.txt +0 -0
Dockerfile CHANGED
@@ -1,23 +1,9 @@
1
- # Sử dụng một base image Alpine có Python 3.12 (nhẹ và ít lỗ hổng hơn)
2
  FROM python:3.12-alpine
3
-
4
  WORKDIR /app
5
-
6
- # Cần cài đặt git nếu bạn có sử dụng nó trong ứng dụng (ví dụ: clone repo khác)
7
- # build-base thường không cần thiết trực tiếp nếu PyTorch được tải từ wheel
8
- RUN apk add --no-cache git curl
9
-
10
  COPY requirements.txt ./
11
  COPY src/ ./src/
12
-
13
- # !!! QUAN TRỌNG: SỬA DÒNG NÀY ĐỂ THÊM --index-url VÀ CHỌN PHIÊN BẢN CUDA CHÍNH XÁC !!!
14
- # Ví dụ với CUDA 11.8 (phổ biến trên các GPU cũ hơn như T4)
15
- RUN pip3 install --no-cache-dir -r requirements.txt --index-url https://download.pytorch.org/whl/cu118
16
- # Hoặc với CUDA 12.1 (hoặc cao hơn nếu GPU trên Space hỗ trợ và PyTorch cung cấp)
17
- # RUN pip3 install --no-cache-dir -r requirements.txt --index-url https://download.pytorch.org/whl/cu121
18
-
19
- EXPOSE 8501
20
-
21
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
22
-
23
- ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
 
1
  FROM python:3.12-alpine
 
2
  WORKDIR /app
3
+ RUN apk add --no-cache \
4
+ build-base \
5
+ curl \
6
+ git
 
7
  COPY requirements.txt ./
8
  COPY src/ ./src/
9
+ RUN pip3 install -r requirements.txt
 
 
 
 
 
 
 
 
 
 
 
requirements.txt CHANGED
Binary files a/requirements.txt and b/requirements.txt differ