Dockerfile 639 B

12345678910111213141516171819202122
  1. # usando python slim para menor instalaçao
  2. FROM python:3.10-slim
  3. WORKDIR /app
  4. # instalando depedencias do ollama
  5. RUN apt-get update && apt-get install -y curl libgomp1 && rm -rf /var/lib/apt/lists/*
  6. # instalando ollama
  7. RUN curl -fsSL https://ollama.com/install.sh | sh
  8. # instalando depedencias do python
  9. COPY requirements.txt .
  10. RUN pip install --no-cache-dir -r requirements.txt
  11. COPY . .
  12. # expondo portas
  13. EXPOSE 8000
  14. # comandso para inicializar o servidor e fazer download da llm
  15. CMD ["sh", "-c", "ollama serve & (ollama list | grep -q tinyllama || ollama pull tinyllama) && uvicorn app.main:app --host 0.0.0.0 --port 8000 & wait"]