| |
| |
| FROM debian:13 |
|
|
| |
| ENV DEBIAN_FRONTEND=noninteractive |
|
|
| |
| RUN apt-get update && \ |
| apt-get install -y \ |
| build-essential \ |
| curl \ |
| ca-certificates \ |
| git \ |
| cmake \ |
| clang \ |
| pkg-config \ |
| ccache \ |
| wget \ |
| vim \ |
| libicu76 \ |
| expect |
|
|
| |
| RUN useradd -m user && \ |
| mkdir -p /home/user/code && \ |
| chown -R user:user /home/user |
|
|
| |
| USER user |
| WORKDIR /home/user |
|
|
| RUN mkdir -p /home/user/code/models && \ |
| mkdir -p /home/user/code/app/wwwroot && \ |
| cd /home/user/code/models && \ |
| wget -q https://huggingface.co/Mungert/Qwen3.5-2B-GGUF/resolve/main/Qwen3.5-2B-q6_k_m.gguf |
|
|
| |
| RUN git clone https://github.com/OpenMathLib/OpenBLAS.git /home/user/code/models/OpenBLAS && \ |
| cd /home/user/code/models/OpenBLAS && \ |
| make -j2 > build.log 2>&1 || (tail -20 build.log && false) |
|
|
| |
| USER root |
| RUN cd /home/user/code/models/OpenBLAS && \ |
| make install > install.log 2>&1 || (tail -20 install.log && false) && \ |
| cp /opt/OpenBLAS/lib/libopenblas* /usr/local/lib/ |
|
|
| |
| USER user |
|
|
| |
| RUN git clone https://github.com/ggerganov/llama.cpp /home/user/code/models/llama.cpp |
|
|
|
|
|
|
| |
| RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh && \ |
| chmod +x dotnet-install.sh && \ |
| ./dotnet-install.sh --channel 10.0 |
|
|
| |
| ENV DOTNET_ROOT=/home/user/.dotnet |
| ENV PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools |
|
|
| |
| RUN whoami && dotnet --version |
|
|
| |
| RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444,required=true \ |
| git clone https://x-access-token:$(cat /run/secrets/GITHUB_TOKEN)@github.com/Mungert69/NetworkMonitorLib.git /home/user/code/NetworkMonitorLib && \ |
| git clone https://x-access-token:$(cat /run/secrets/GITHUB_TOKEN)@github.com/Mungert69/NetworkMonitorLLM.git /home/user/code/NetworkMonitorLLM && \ |
| git clone https://x-access-token:$(cat /run/secrets/GITHUB_TOKEN)@github.com/Mungert69/NetworkMonitorData.git /home/user/code/NetworkMonitorData |
|
|
| |
| RUN git -C /home/user/code/models/llama.cpp apply \ |
| /home/user/code/NetworkMonitorLLM/patches/qwen35_imrope_context_shift_fix.diff |
| |
| |
|
|
| |
| RUN cd /home/user/code/models/llama.cpp && \ |
| export PKG_CONFIG_PATH=/opt/OpenBLAS/lib/pkgconfig:$PKG_CONFIG_PATH && \ |
| cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS=/home/user/code/models/OpenBLAS -DLLAMA_CURL=OFF && \ |
| cmake --build build --config Release -j2 && \ |
| cp /home/user/code/models/llama.cpp/build/bin/* /home/user/code/models/llama.cpp/ |
|
|
| |
| COPY --chown=user:user appsettings.json /home/user/code/app/appsettings.json |
| COPY --chown=user:user index.html /home/user/code/app/wwwroot/index.html |
|
|
|
|
| |
| WORKDIR /home/user/code/models |
|
|
|
|
| |
| EXPOSE 7860 |
| |
| WORKDIR /home/user/code/NetworkMonitorLLM |
|
|
| |
| RUN dotnet restore && \ |
| dotnet build -c Release |
|
|
| RUN cp -r /home/user/code/NetworkMonitorLLM/bin/Release/net10.0/* /home/user/code/app/ && \ |
| rm -rf /home/user/code/NetworkMonitorLib /home/user/code/NetworkMonitorLLM /home/user/code/NetworkMonitorData |
|
|
| |
| WORKDIR /home/user/code/app |
|
|
| CMD ["dotnet", "NetworkMonitorLLM.dll", "--urls", "http://0.0.0.0:7860"] |
|
|