| FROM python:3.11-slim | |
| RUN apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/* | |
| RUN curl -fsSL https://ollama.com/install.sh | sh | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| COPY app.py . | |
| COPY database.py . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # PUXA MODELO 1.5B | |
| RUN ollama serve & \ | |
| until curl -s http://localhost:11434/api/tags > /dev/null; do sleep 2; done && \ | |
| ollama pull qwen2.5:1.5b-instruct-q4_0 && \ | |
| kill $! | |
| EXPOSE 7860 | |
| CMD ["python", "app.py"] |