mirror of
https://github.com/mudler/LocalAI.git
synced 2024-12-18 20:27:57 +00:00
feat: make images to build sources on start (#124)
Signed-off-by: mudler <mudler@mocaccino.org>
This commit is contained in:
parent
78503c62b7
commit
16773e2a35
11
Dockerfile
11
Dockerfile
@ -1,14 +1,9 @@
|
|||||||
ARG GO_VERSION=1.20
|
ARG GO_VERSION=1.20
|
||||||
ARG DEBIAN_VERSION=11
|
|
||||||
ARG BUILD_TYPE=
|
ARG BUILD_TYPE=
|
||||||
|
FROM golang:$GO_VERSION
|
||||||
FROM golang:$GO_VERSION as builder
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
RUN apt-get update && apt-get install -y cmake
|
RUN apt-get update && apt-get install -y cmake
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN make build
|
RUN make prepare-sources
|
||||||
|
|
||||||
FROM debian:$DEBIAN_VERSION
|
|
||||||
COPY --from=builder /build/local-ai /usr/bin/local-ai
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
ENTRYPOINT [ "/usr/bin/local-ai" ]
|
ENTRYPOINT [ "/build/entrypoint.sh" ]
|
||||||
|
13
Makefile
13
Makefile
@ -79,7 +79,7 @@ go-gpt2/libgpt2.a: go-gpt2
|
|||||||
go-llama:
|
go-llama:
|
||||||
git clone -b $(GOLLAMA_VERSION) --recurse-submodules https://github.com/go-skynet/go-llama.cpp go-llama
|
git clone -b $(GOLLAMA_VERSION) --recurse-submodules https://github.com/go-skynet/go-llama.cpp go-llama
|
||||||
|
|
||||||
go-llama/libbinding.a: go-llama
|
go-llama/libbinding.a: go-llama
|
||||||
$(MAKE) -C go-llama $(GENERIC_PREFIX)libbinding.a
|
$(MAKE) -C go-llama $(GENERIC_PREFIX)libbinding.a
|
||||||
|
|
||||||
replace:
|
replace:
|
||||||
@ -87,7 +87,16 @@ replace:
|
|||||||
$(GOCMD) mod edit -replace github.com/go-skynet/go-gpt4all-j.cpp=$(shell pwd)/go-gpt4all-j
|
$(GOCMD) mod edit -replace github.com/go-skynet/go-gpt4all-j.cpp=$(shell pwd)/go-gpt4all-j
|
||||||
$(GOCMD) mod edit -replace github.com/go-skynet/go-gpt2.cpp=$(shell pwd)/go-gpt2
|
$(GOCMD) mod edit -replace github.com/go-skynet/go-gpt2.cpp=$(shell pwd)/go-gpt2
|
||||||
|
|
||||||
prepare: go-llama/libbinding.a go-gpt4all-j/libgptj.a go-gpt2/libgpt2.a replace
|
prepare-sources: go-llama go-gpt2 go-gpt4all-j
|
||||||
|
$(GOCMD) mod download
|
||||||
|
|
||||||
|
rebuild:
|
||||||
|
$(MAKE) -C go-llama clean
|
||||||
|
$(MAKE) -C go-gpt4all-j clean
|
||||||
|
$(MAKE) -C go-gpt2 clean
|
||||||
|
$(MAKE) build
|
||||||
|
|
||||||
|
prepare: prepare-sources go-llama/libbinding.a go-gpt4all-j/libgptj.a go-gpt2/libgpt2.a replace
|
||||||
|
|
||||||
clean: ## Remove build related file
|
clean: ## Remove build related file
|
||||||
rm -fr ./go-llama
|
rm -fr ./go-llama
|
||||||
|
7
entrypoint.sh
Executable file
7
entrypoint.sh
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd /build
|
||||||
|
|
||||||
|
make build
|
||||||
|
|
||||||
|
./local-ai "$@"
|
Loading…
Reference in New Issue
Block a user