akra35567 commited on
Commit
ac0321c
·
verified ·
1 Parent(s): 440898e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -3
Dockerfile CHANGED
@@ -1,17 +1,27 @@
 
1
  FROM ollama/ollama:latest
2
 
3
- EXPOSE 7860
4
- EXPOSE 11434
 
5
 
6
- RUN ollama pull qwen2.5:7b
 
 
 
 
7
 
 
8
  COPY app.py /app/app.py
9
  COPY requirements.txt /app/requirements.txt
10
  WORKDIR /app
11
 
 
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
 
14
  HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
15
  CMD curl -f http://localhost:7860/health || exit 1
16
 
 
17
  CMD ["python", "app.py"]
 
1
+ # Dockerfile
2
  FROM ollama/ollama:latest
3
 
4
+ # PORTAS
5
+ EXPOSE 7860 # HF Space
6
+ EXPOSE 11434 # Ollama
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 (que inicia ollama serve + Flask)
27
  CMD ["python", "app.py"]