AIencoder/Axon-Llama-GUI
0
1# Stage 1: Grab the server binary from the official server image2FROM ghcr.io/ggml-org/llama.cpp:server AS source3 4# Stage 2: Setup your environment using the full image5FROM ghcr.io/ggml-org/llama.cpp:full6 7# 1. Copy llama-server binary8COPY --from=source /app/llama-server /usr/local/bin/llama-server9 10# 2. Setup Environment11WORKDIR /app12ENV HF_HOME=/app/.cache13ENV NUMBA_CACHE_DIR=/app/.cache14ENV LLAMA_CACHE=/app/.cache/llama.cpp15 16# 3. Install Python & Tools17RUN apt-get update && \18 apt-get install -y --no-install-recommends \19 python3 \20 python3-pip \21 dos2unix \22 curl \23 && rm -rf /var/lib/apt/lists/* \24 && apt-get clean25 26# 4. Install Python Libraries27RUN pip3 install --no-cache-dir --break-system-packages huggingface_hub28 29# 5. Copy and Fix the Start Script30COPY start.sh /app/start.sh31RUN dos2unix /app/start.sh && chmod +x /app/start.sh32 33# 6. Create directories and set permissions34RUN mkdir -p /app/.cache/llama.cpp \35 && mkdir -p /app/models \36 && chmod -R 777 /app37 38# 7. Expose port39EXPOSE 786040 41# 8. Health check42HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \43 CMD curl -f http://localhost:7860/health || exit 144 45# 9. Start46ENTRYPOINT ["/app/start.sh"]