2023-07-03 22:56:17 +00:00
|
|
|
FROM golang:1.20
|
|
|
|
WORKDIR /go/src/github.com/jmorganca/ollama
|
|
|
|
COPY . .
|
|
|
|
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
|
2023-07-06 20:34:14 +00:00
|
|
|
EXPOSE 11434
|
2023-07-03 22:56:17 +00:00
|
|
|
ARG USER=ollama
|
|
|
|
ARG GROUP=ollama
|
|
|
|
RUN addgroup -g 1000 $GROUP && adduser -u 1000 -DG $GROUP $USER
|
|
|
|
USER $USER:$GROUP
|
|
|
|
ENTRYPOINT ["/bin/ollama"]
|
2023-07-08 03:43:44 +00:00
|
|
|
ENV OLLAMA_HOST 0.0.0.0
|
2023-07-06 20:34:14 +00:00
|
|
|
CMD ["serve"]
|