Move to multistage Dockerfile
This commit is contained in:
parent
34ac96edd7
commit
d0a04bae84
@ -1,6 +1,14 @@
|
|||||||
|
FROM golang as builder
|
||||||
|
|
||||||
|
WORKDIR /repo
|
||||||
|
COPY . /repo
|
||||||
|
|
||||||
|
RUN make build
|
||||||
|
|
||||||
FROM debian:bookworm
|
FROM debian:bookworm
|
||||||
|
|
||||||
COPY _build/scn_backend /app/scnserver
|
COPY --from=builder /repo/_build/scn_backend /app/scnserver
|
||||||
|
|
||||||
COPY DOCKER_GIT_INFO /app/DOCKER_GIT_INFO
|
COPY DOCKER_GIT_INFO /app/DOCKER_GIT_INFO
|
||||||
|
|
||||||
RUN mkdir /data
|
RUN mkdir /data
|
||||||
|
@ -5,7 +5,7 @@ PORT=9090
|
|||||||
NAMESPACE=$(shell git rev-parse --abbrev-ref HEAD)
|
NAMESPACE=$(shell git rev-parse --abbrev-ref HEAD)
|
||||||
HASH=$(shell git rev-parse HEAD)
|
HASH=$(shell git rev-parse HEAD)
|
||||||
|
|
||||||
.PHONY: test swagger pygmentize
|
.PHONY: test swagger pygmentize docker
|
||||||
|
|
||||||
build: swagger pygmentize fmt
|
build: swagger pygmentize fmt
|
||||||
mkdir -p _build
|
mkdir -p _build
|
||||||
@ -21,7 +21,7 @@ gow:
|
|||||||
which gow || go install github.com/mitranim/gow@latest
|
which gow || go install github.com/mitranim/gow@latest
|
||||||
gow -e "go,mod,html,css,json,yaml,js" run -tags "timetzdata sqlite_fts5 sqlite_foreign_keys" blackforestbytes.com/simplecloudnotifier/cmd/scnserver
|
gow -e "go,mod,html,css,json,yaml,js" run -tags "timetzdata sqlite_fts5 sqlite_foreign_keys" blackforestbytes.com/simplecloudnotifier/cmd/scnserver
|
||||||
|
|
||||||
docker: build
|
docker:
|
||||||
[ ! -f "DOCKER_GIT_INFO" ] || rm DOCKER_GIT_INFO
|
[ ! -f "DOCKER_GIT_INFO" ] || rm DOCKER_GIT_INFO
|
||||||
git rev-parse --abbrev-ref HEAD >> DOCKER_GIT_INFO
|
git rev-parse --abbrev-ref HEAD >> DOCKER_GIT_INFO
|
||||||
git rev-parse HEAD >> DOCKER_GIT_INFO
|
git rev-parse HEAD >> DOCKER_GIT_INFO
|
||||||
|
Loading…
Reference in New Issue
Block a user