|
|
|
|
|
FROM python:3.11-slim |
|
|
|
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
|
build-essential \ |
|
|
cmake \ |
|
|
git \ |
|
|
aria2 \ |
|
|
wget \ |
|
|
libcurl4-openssl-dev \ |
|
|
pkg-config \ |
|
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
|
RUN git clone https://github.com/ggerganov/llama.cpp.git |
|
|
WORKDIR /app/llama.cpp |
|
|
RUN mkdir build |
|
|
WORKDIR /app/llama.cpp/build |
|
|
RUN cmake .. -DLLAMA_CURL=1 |
|
|
RUN cmake --build . --config Release |
|
|
WORKDIR /app |
|
|
|
|
|
|
|
|
RUN mkdir -p logs data config server models .kaggle .streamlit |
|
|
|
|
|
|
|
|
RUN wget -P models/ "https://huggingface.co/ggml-org/Qwen2.5-Coder-1.5B-Q8_0-GGUF/resolve/main/qwen2.5-coder-1.5b-q8_0.gguf" |
|
|
|
|
|
|
|
|
COPY . /app |
|
|
|
|
|
|
|
|
RUN chmod +x ./start.sh |
|
|
|
|
|
|
|
|
RUN chown -R 1000:1000 logs data config server models .kaggle .streamlit |
|
|
|
|
|
|
|
|
ENV KAGGLE_CONFIG_DIR=/app |
|
|
ENV STREAMLIT_SERVER_INFO_DIR=/app/.streamlit |
|
|
ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false |
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
|
|
|
ENTRYPOINT ["/app/start.sh"] |