Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dockerfile #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add dockerfile #31

wants to merge 1 commit into from

Conversation

yarray
Copy link

@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.

@bialad
Copy link

bialad commented May 12, 2023

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

@YaKaiLi
Copy link

YaKaiLi 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.

None yet

3 participants