|
|
FROM nvidia/cuda:12.1.0-devel-ubuntu22.04 |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
|
python3.11 \ |
|
|
python3.11-dev \ |
|
|
python3-pip \ |
|
|
build-essential \ |
|
|
cmake \ |
|
|
git \ |
|
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
|
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1 && \ |
|
|
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 |
|
|
|
|
|
|
|
|
RUN python -m pip install --upgrade pip |
|
|
|
|
|
|
|
|
COPY requirements.txt . |
|
|
|
|
|
|
|
|
RUN CMAKE_ARGS="-DLLAMA_CUDA=on" pip install llama-cpp-python --no-cache-dir |
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
|
|
|
COPY . . |
|
|
|
|
|
|
|
|
RUN mkdir -p /data |
|
|
|
|
|
|
|
|
ENV PYTHONUNBUFFERED=1 |
|
|
ENV MODEL_REPO=daskalos-apps/phi4-cybersec-Q4_K_M |
|
|
ENV MODEL_FILENAME=phi4-mini-instruct-Q4_K_M.gguf |
|
|
ENV USE_RAG=false |
|
|
ENV CACHE_ENABLED=true |
|
|
|
|
|
|
|
|
EXPOSE 8000 |
|
|
|
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ |
|
|
CMD python -c "import requests; requests.get('http://localhost:8000/health')" |
|
|
|
|
|
|
|
|
CMD ["python", "main.py"] |
|
|
|