cloudunity/Ornith-api
0
1FROM python:3.12-slim2 3ENV DEBIAN_FRONTEND=noninteractive4ENV PYTHONUNBUFFERED=15ENV PIP_NO_CACHE_DIR=16 7WORKDIR /app8 9RUN apt-get update && apt-get install -y --no-install-recommends \10 git \11 cmake \12 build-essential \13 curl \14 ca-certificates \15 libgomp1 \16 && rm -rf /var/lib/apt/lists/*17 18 19# Build llama.cpp for CPU.20RUN git clone --depth 1 https://github.com/ggml-org/llama.cpp.git /tmp/llama.cpp \21 && cmake -S /tmp/llama.cpp -B /tmp/llama.cpp/build \22 -DGGML_NATIVE=OFF \23 -DGGML_OPENMP=ON \24 -DLLAMA_BUILD_SERVER=ON \25 -DLLAMA_BUILD_TESTS=OFF \26 -DLLAMA_BUILD_EXAMPLES=ON \27 && cmake --build /tmp/llama.cpp/build \28 --config Release \29 --target llama-server \30 -j2 \31 && mkdir -p /opt/llama \32 && cp /tmp/llama.cpp/build/bin/llama-server /opt/llama/llama-server \33 && cp /tmp/llama.cpp/build/bin/*.so* /opt/llama/ 2>/dev/null || true \34 && rm -rf /tmp/llama.cpp35 36 37# Hugging Face downloader.38RUN pip install --upgrade pip \39 && pip install huggingface_hub40 41 42COPY start.sh /app/start.sh43RUN chmod +x /app/start.sh44 45 46EXPOSE 786047 48 49CMD ["/app/start.sh"]