1adaodoze commited on
Commit
b8b174b
·
verified ·
1 Parent(s): d3c9740

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -5
Dockerfile CHANGED
@@ -1,25 +1,28 @@
 
1
  FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
5
- # Instala dependências do sistema
6
  RUN apt-get update && apt-get install -y \
7
  gcc g++ make cmake git libopenblas-dev \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
- # Instala o llama-cpp-python a partir do wheel específico para o HF Spaces (Luigi)
11
  RUN pip install --no-cache-dir --root-user-action=ignore \
12
- https://huggingface.co/Luigi/llama-cpp-python-wheels-hf-spaces-free-cpu/resolve/main/llama_cpp_python-0.3.22-cp310-cp310-linux_x86_64.whl
13
 
14
- # Copia e instala as demais dependências
15
  COPY requirements.txt .
16
  RUN pip install --no-cache-dir --root-user-action=ignore -r requirements.txt
17
 
18
- # Copia o código
19
  COPY . .
20
 
 
21
  ENV PYTHONUNBUFFERED=1
22
  ENV GRADIO_SERVER_NAME=0.0.0.0
23
  EXPOSE 7860
24
 
 
25
  CMD ["python", "app.py"]
 
1
+ # Use Python 3.10, que é o compatível com o wheel
2
  FROM python:3.10-slim
3
 
4
  WORKDIR /app
5
 
6
+ # 1. Instala as dependências de sistema necessárias para o OpenBLAS
7
  RUN apt-get update && apt-get install -y \
8
  gcc g++ make cmake git libopenblas-dev \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # 2. Instala o llama-cpp-python a partir do wheel pré-compilado oficial (GitHub Release)
12
  RUN pip install --no-cache-dir --root-user-action=ignore \
13
+ https://github.com/abetlen/llama-cpp-python/releases/download/v0.3.19/llama_cpp_python-0.3.19-cp310-cp310-linux_x86_64.whl
14
 
15
+ # 3. Instala as demais dependências do requirements.txt
16
  COPY requirements.txt .
17
  RUN pip install --no-cache-dir --root-user-action=ignore -r requirements.txt
18
 
19
+ # 4. Copia o código da aplicação
20
  COPY . .
21
 
22
+ # 5. Configurações do Gradio
23
  ENV PYTHONUNBUFFERED=1
24
  ENV GRADIO_SERVER_NAME=0.0.0.0
25
  EXPOSE 7860
26
 
27
+ # 6. Comando para iniciar o app
28
  CMD ["python", "app.py"]