llama_server / Dockerfile
aliroohan179's picture
Update Dockerfile
3347fcb verified
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
# Install dependencies for Homebrew and building llama.cpp
RUN apt update && apt install -y \
build-essential \
curl \
file \
git \
sudo \
procps \
python3 \
python3-pip \
libssl-dev \
libcurl4-openssl-dev \
ruby \
unzip \
ca-certificates \
gnupg \
software-properties-common
# Create a non-root user (Homebrew prefers not to run as root)
RUN useradd -m brewuser && echo "brewuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
USER brewuser
WORKDIR /home/brewuser
# Install Homebrew
RUN git clone https://github.com/Homebrew/brew ~/.linuxbrew/Homebrew && \
mkdir ~/.linuxbrew/bin && \
ln -s ~/.linuxbrew/Homebrew/bin/brew ~/.linuxbrew/bin/
ENV PATH="/home/brewuser/.linuxbrew/bin:/home/brewuser/.linuxbrew/sbin:$PATH"
# Install llama-cpp via Homebrew
RUN brew update && brew install llama.cpp
# Set port for llama-server
EXPOSE 8080
# Run like on your machine
EXPOSE 7860
CMD ["llama-server", "-hf", "ggml-org/SmolVLM-500M-Instruct-GGUF", "--host", "0.0.0.0", "--port", "7860"]