From da914134979a1242558e0d251f95fdd2ddc0a216 Mon Sep 17 00:00:00 2001 From: Jah-yee Date: Fri, 13 Mar 2026 00:36:40 +0800 Subject: [PATCH] Add Dockerfile for containerized deployment - Based on python:3.11-slim - Includes cmake, build-essential, git for building - Initializes git submodules - Builds the project with CMake - Adds run_inference.py to PATH Closes #433 --- Dockerfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..9c4feb456 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +# BitNet.cpp Docker Image +# For running 1-bit LLM inference on CPU + +FROM python:3.11-slim + +# Install build dependencies +RUN apt-get update && apt-get install -y \ + cmake \ + build-essential \ + git \ + wget \ + && rm -rf /var/lib/apt/lists/* + +# Set working directory +WORKDIR /app + +# Copy project files +COPY . . + +# Initialize git submodules +RUN git submodule update --init --recursive + +# Build the project +RUN cmake -B build && cmake --build build --config Release + +# Set environment variables +ENV PYTHONPATH=/app/build/bin:$PYTHONPATH + +# Default command - show help +CMD ["python3", "run_inference.py", "--help"]