| FROM ubuntu:22.04 |
|
|
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| python3 python3-pip curl ca-certificates \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| RUN curl -L https://github.com/ggml-org/llama.cpp/releases/download/b8468/llama-b8468-bin-ubuntu-x64.tar.gz \ |
| -o /tmp/llama.tar.gz \ |
| && mkdir -p /opt/llama \ |
| && tar xzf /tmp/llama.tar.gz -C /opt/llama \ |
| && rm /tmp/llama.tar.gz |
|
|
| RUN useradd -m -u 1000 user |
| USER user |
| ENV HOME=/home/user PATH="/home/user/.local/bin:$PATH" |
| WORKDIR /home/user/app |
|
|
| RUN pip3 install --no-cache-dir --user huggingface_hub |
|
|
| COPY --chown=user start.sh . |
| RUN chmod +x start.sh |
|
|
| EXPOSE 7860 |
| CMD ["bash", "start.sh"] |