Skip to content

Add dockerfile#31

Open
yarray wants to merge 1 commit into
keldenl:masterfrom
yarray:master
Open

Add dockerfile#31
yarray wants to merge 1 commit into
keldenl:masterfrom
yarray:master

Conversation

@yarray
Copy link
Copy Markdown

@yarray yarray commented Apr 26, 2023

Add dockerfile and modify documentation along with testing script accordingly. Note when ENV=docker, test-installation.sh will not check the existence of the model file to avoid error.

@tmansson
Copy link
Copy Markdown

Great work, but a suggestion for a slightly more efficient Dockerfile.

And i suggest using port 8000 instead of 443, since 443 is restricted on linux systems.

FROM ghcr.io/ggerganov/llama.cpp:light

RUN mkdir -p /llama.cpp/models
RUN mv /main /llama.cpp/

RUN apt update && apt install -y curl xz-utils
RUN curl -O https://nodejs.org/dist/v18.16.0/node-v18.16.0-linux-x64.tar.xz && tar xf node-v18.16.0-linux-x64.tar.xz
RUN mv node-v18.16.0-linux-x64/bin/* /usr/bin/ && mv node-v18.16.0-linux-x64/lib/* /usr/lib/ && mv node-v18.16.0-linux-x64/include/* /usr/include/

COPY ./ /gpt-llama.cpp

WORKDIR /gpt-llama.cpp

RUN npm install
EXPOSE 8000

ENTRYPOINT ["/bin/bash", "-c"]
CMD ["npm start"]

and a docker-compose file to go along with it.

version: "3.9"

services:
  gpt-llama:
    container_name: gpt-llama
    build: .
    ports:
      - 8000:8000
    environment:
      - PORT=8000
    volumes:
      - ../llama.cpp/models:/llama.cpp/models:ro

@star5o
Copy link
Copy Markdown

star5o commented Jun 8, 2023

Great work! I will test it locally soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants