update Dockerfile

This commit is contained in:
Jeffrey Morgan 2023-07-03 18:56:17 -04:00
parent 0240165388
commit 6292f4b64c
2 changed files with 23 additions and 5 deletions

7
.dockerignore Normal file
View file

@ -0,0 +1,7 @@
build
llama/build
.venv
.vscode
ollama
app
web

View file

@ -1,5 +1,16 @@
FROM python:3-slim-bullseye
RUN apt-get update && apt-get install -y build-essential gcc ninja-build libopenblas-dev
RUN python -m pip install --upgrade pip setuptools
RUN CMAKE_ARGS="-DLLAMA_OPENBLAS=on" FORCE_CMAKE=1 pip install ollama
ENTRYPOINT ["ollama"]
FROM golang:1.20
RUN apt-get update && apt-get install -y cmake
WORKDIR /go/src/github.com/jmorganca/ollama
COPY . .
RUN go generate ./...
RUN CGO_ENABLED=1 go build -ldflags '-linkmode external -extldflags "-static"' .
FROM alpine
COPY --from=0 /go/src/github.com/jmorganca/ollama/ollama /bin/ollama
EXPOSE 80
EXPOSE 443
ARG USER=ollama
ARG GROUP=ollama
RUN addgroup -g 1000 $GROUP && adduser -u 1000 -DG $GROUP $USER
USER $USER:$GROUP
ENTRYPOINT ["/bin/ollama"]