akra35567 commited on
Commit
05f67c9
·
verified ·
1 Parent(s): ffadc1d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -14
Dockerfile CHANGED
@@ -1,27 +1,39 @@
1
  # Dockerfile
2
- FROM ollama/ollama:latest
3
 
4
- # PORTAS
5
- EXPOSE 7860
6
- EXPOSE 11434
 
 
 
7
 
8
- # INICIA OLLAMA EM BACKGROUND + PUXA MODELO
9
- RUN ollama serve & \
10
- sleep 10 && \
11
- ollama pull qwen2.5:7b && \
12
- pkill ollama
13
 
14
- # COPIA ARQUIVOS
15
- COPY app.py /app/app.py
16
- COPY requirements.txt /app/requirements.txt
17
  WORKDIR /app
18
 
19
- # INSTALA DEPENDÊNCIAS
 
 
 
 
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
 
 
 
 
 
 
 
 
 
 
22
  # HEALTHCHECK
23
  HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
24
  CMD curl -f http://localhost:7860/health || exit 1
25
 
26
- # INICIA app.py (inicia ollama serve + Flask)
27
  CMD ["python", "app.py"]
 
1
  # Dockerfile
2
+ FROM python:3.11-slim
3
 
4
+ # INSTALA DEPENDÊNCIAS DO SISTEMA
5
+ RUN apt-get update && \
6
+ apt-get install -y --no-install-recommends \
7
+ curl \
8
+ ca-certificates \
9
+ && rm -rf /var/lib/apt/lists/*
10
 
11
+ # BAIXA E INSTALA OLLAMA
12
+ RUN curl -fsSL https://ollama.com/install.sh | sh
 
 
 
13
 
14
+ # CRIA DIRETÓRIO
 
 
15
  WORKDIR /app
16
 
17
+ # COPIA ARQUIVOS
18
+ COPY requirements.txt .
19
+ COPY app.py .
20
+
21
+ # INSTALA PYTHON DEPENDÊNCIAS
22
  RUN pip install --no-cache-dir -r requirements.txt
23
 
24
+ # PORTAS
25
+ EXPOSE 7860 # HF Space
26
+ EXPOSE 11434 # Ollama
27
+
28
+ # INICIA OLLAMA + PUXA MODELO
29
+ RUN ollama serve & \
30
+ sleep 15 && \
31
+ ollama pull qwen2.5:7b && \
32
+ pkill ollama
33
+
34
  # HEALTHCHECK
35
  HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
36
  CMD curl -f http://localhost:7860/health || exit 1
37
 
38
+ # INICIA app.py (inicia ollama + Flask)
39
  CMD ["python", "app.py"]