1adaodoze commited on
Commit
cd7e235
·
verified ·
1 Parent(s): e93d873

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -0
Dockerfile ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Dockerfile
2
+ FROM python:3.10-slim
3
+
4
+ WORKDIR /app
5
+
6
+ # Instala dependências do sistema para OpenBLAS (aceleração de CPU)
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
+ # 1. Instala o llama-cpp-python a partir de um wheel pré-compilado (rápido e sem timeout)
12
+ RUN pip install --no-cache-dir \
13
+ 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
14
+
15
+ # 2. Instala as demais dependências do requirements.txt
16
+ COPY requirements.txt .
17
+ RUN pip install --no-cache-dir -r requirements.txt
18
+
19
+ # Copia o código da aplicação
20
+ COPY . .
21
+
22
+ # Configura o Gradio para rodar no ambiente do Hugging Face
23
+ ENV PYTHONUNBUFFERED=1
24
+ ENV GRADIO_SERVER_NAME=0.0.0.0
25
+ EXPOSE 7860
26
+
27
+ # Comando para iniciar o app
28
+ CMD ["python", "app.py"]