HuuDatLego commited on
Commit
71ef1b8
·
verified ·
1 Parent(s): 99a6b36

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -15
Dockerfile CHANGED
@@ -1,30 +1,22 @@
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 \
7
  curl \
8
- build-essential \
9
  && rm -rf /var/lib/apt/lists/*
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
 
1
+ # Dùng image đã cài sẵn llama-cpp-python (bản CPU)
2
+ FROM ghcr.io/abetlen/llama-cpp-python:latest
3
 
4
+ # Cài đặt thêm các công cụ hệ thống bạn cần (ffmpeg, redis)
5
  RUN apt-get update && apt-get install -y \
6
  ffmpeg \
7
  redis-server \
8
  curl \
 
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
  WORKDIR /app
12
 
13
+ # Copy requirements cài các thư viện còn lại
 
 
 
 
 
 
 
 
 
 
14
  COPY requirements.txt ./
15
+
16
+ # Cài đặt các thư viện của bạn (bỏ qua llama-cpp-python vì đã có sẵn trong image)
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
19
+ # Copy nguồn
20
  COPY . .
21
 
22
  RUN mkdir -p static/results temp && chmod +x start.sh