|
|
|
FROM python:3.10-slim |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
build-essential \ |
|
cmake \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
USER user |
|
|
|
|
|
ENV HOME=/home/user |
|
ENV PATH=$HOME/.local/bin:$PATH |
|
WORKDIR $HOME/app |
|
|
|
|
|
COPY --chown=user requirements.txt . |
|
|
|
|
|
|
|
ENV CMAKE_ARGS="-DLLAMA_CUBLAS=OFF -DLLAMA_METAL=OFF" |
|
|
|
|
|
RUN pip install --no-cache-dir --user -r requirements.txt |
|
|
|
|
|
RUN huggingface-cli download Dnfs/gema-4b-indra10k-model1-Q4_K_M-GGUF \ |
|
--local-dir ./model \ |
|
--local-dir-use-symlinks False |
|
|
|
|
|
COPY --chown=user app.py . |
|
|
|
|
|
EXPOSE 8000 |
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ |
|
CMD curl -f http://localhost:8000/health || exit 1 |
|
|
|
|
|
CMD ["python", "app.py"] |