ollama/Dockerfile

33 lines
814 B
Text
Raw Normal View History

FROM golang:1.22-alpine as build
2023-09-22 18:57:31 +00:00
RUN apk add cmake build-base bash git
2023-09-08 20:41:49 +00:00
WORKDIR /app
ADD . .
ARG GIN_MODE=release
RUN OLLAMA_CUSTOM_CPU_DEFS="-DLLAMA_NATIVE=ON" go generate ./... && \
go build -ldflags="-s -w"
FROM alpine:latest
RUN apk add libstdc++ libgomp supervisor
WORKDIR /ollama
COPY --from=build /app/ollama /ollama
COPY --from=build /app/serve.sh /ollama/serve.sh
COPY --from=build /app/run_model.sh /ollama/run_model.sh
COPY --from=build /app/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY --from=build /app/llm/build/linux/x86_64/cpu/src/libllama.so /usr/lib
COPY --from=build /app/llm/build/linux/x86_64/cpu/ggml/src/libggml.so /usr/lib
ENV MODEL_NAME="llama"
ENV OLLAMA_HOST="0.0.0.0:8080"
EXPOSE 8080
2023-09-06 21:14:20 +00:00
CMD ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]