| FROM python:3.11-slim |
|
|
| |
| RUN apt-get update && \ |
| apt-get install -y --no-install-recommends \ |
| 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 . |
|
|
| |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| |
| EXPOSE 7860 |
| EXPOSE 11434 |
|
|
| |
| RUN ollama serve & \ |
| OLLAMA_PID=$! && \ |
| sleep 15 && \ |
| ollama pull qwen2.5:7b && \ |
| kill $OLLAMA_PID || true |
|
|
| |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ |
| CMD curl -f http://localhost:7860/health || exit 1 |
|
|
| |
| CMD ["python", "app.py"] |