HuuDatLego commited on
Commit
99a6b36
·
verified ·
1 Parent(s): 35f8544

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -8
Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
  FROM python:3.11-slim
2
 
3
- # Cài đặt công cụ hệ thống (ffmpeg, redis)
4
  RUN apt-get update && apt-get install -y \
5
  ffmpeg \
6
  redis-server \
@@ -10,19 +10,23 @@ RUN apt-get update && apt-get install -y \
10
 
11
  WORKDIR /app
12
 
13
- # Copy danh sách thư viện
14
- COPY requirements.txt ./
15
 
16
- # Cài đặt llama-cpp-python bản chuẩn Linux từ kho đã build sẵn (NHANH)
17
- RUN pip install --no-cache-dir llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
 
 
 
 
18
 
19
- # Cài đặt các gói còn lại từ requirements.txt của bạn (DÙNG PIP CHO GIỐNG BẢN GỐC)
 
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
22
- # Copy bộ code của bạn lên
23
  COPY . .
24
 
25
- # Tạo thư mục cần thiết và cấp quyền
26
  RUN mkdir -p static/results temp && chmod +x start.sh
27
 
28
  EXPOSE 7860
 
1
  FROM python:3.11-slim
2
 
3
+ # Cài đặt công cụ hệ thống
4
  RUN apt-get update && apt-get install -y \
5
  ffmpeg \
6
  redis-server \
 
10
 
11
  WORKDIR /app
12
 
13
+ # 1. Cài đặt các công cụ bổ trợ trước
14
+ RUN pip install --no-cache-dir setuptools wheel auditwheel
15
 
16
+ # 2. ÉP CÀI ĐẶT LLAMA-CPP-PYTHON BẢN BINARY (KHÔNG CHO PHÉP BUILD TỪ SOURCE)
17
+ # Mình dùng --only-binary để cấm nó tự build, bắt nó phải tìm bản đã có sẵn
18
+ RUN pip install --no-cache-dir \
19
+ --only-binary=:all: \
20
+ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \
21
+ llama-cpp-python
22
 
23
+ # 3. Cài đặt các thư viện còn lại
24
+ COPY requirements.txt ./
25
  RUN pip install --no-cache-dir -r requirements.txt
26
 
27
+ # Copy bộ code
28
  COPY . .
29
 
 
30
  RUN mkdir -p static/results temp && chmod +x start.sh
31
 
32
  EXPOSE 7860