OLLAMA / Dockerfile
akra35567's picture
Update Dockerfile
3501991 verified
raw
history blame
832 Bytes
# Dockerfile
FROM python:3.11-slim
# INSTALA DEPENDÊNCIAS DO SISTEMA
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# BAIXA E INSTALA OLLAMA
RUN curl -fsSL https://ollama.com/install.sh | sh
# CRIA DIRETÓRIO
WORKDIR /app
# COPIA ARQUIVOS
COPY requirements.txt .
COPY app.py .
# INSTALA PYTHON DEPENDÊNCIAS
RUN pip install --no-cache-dir -r requirements.txt
# PORTAS
EXPOSE 7860
EXPOSE 11434
# INICIA OLLAMA + PUXA MODELO
RUN ollama serve & \
sleep 15 && \
ollama pull qwen2.5:7b && \
pkill ollama
# HEALTHCHECK
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost:7860/health || exit 1
# INICIA app.py (inicia ollama + Flask)
CMD ["python", "app.py"]