akra35567 commited on
Commit
395527b
·
verified ·
1 Parent(s): 3501991

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -8
Dockerfile CHANGED
@@ -1,12 +1,11 @@
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
@@ -25,15 +24,16 @@ RUN pip install --no-cache-dir -r requirements.txt
25
  EXPOSE 7860
26
  EXPOSE 11434
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"]
 
 
1
  FROM python:3.11-slim
2
 
3
  # INSTALA DEPENDÊNCIAS DO SISTEMA
4
  RUN apt-get update && \
5
  apt-get install -y --no-install-recommends \
6
+ curl \
7
+ ca-certificates \
8
+ && rm -rf /var/lib/apt/lists/*
9
 
10
  # BAIXA E INSTALA OLLAMA
11
  RUN curl -fsSL https://ollama.com/install.sh | sh
 
24
  EXPOSE 7860
25
  EXPOSE 11434
26
 
27
+ # PUXA MODELO DURANTE BUILD (com PID tracking)
28
  RUN ollama serve & \
29
+ OLLAMA_PID=$! && \
30
  sleep 15 && \
31
  ollama pull qwen2.5:7b && \
32
+ kill $OLLAMA_PID || true
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
39
  CMD ["python", "app.py"]