diff options
author | Marco Andronaco <andronacomarco@gmail.com> | 2024-10-05 21:36:05 +0200 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-10-06 13:34:29 +0200 |
commit | 385586d383acd0868ace3f5da2094dd87c1b89e3 (patch) | |
tree | 7a2921e29e0fdf773f64f5aa492470e43bc113fe /contrib/Dockerfile | |
parent | 836c0cc75c2f28cccff5892c1357873c1a29945a (diff) | |
download | cerrado-385586d383acd0868ace3f5da2094dd87c1b89e3.tar.gz cerrado-385586d383acd0868ace3f5da2094dd87c1b89e3.tar.bz2 cerrado-385586d383acd0868ace3f5da2094dd87c1b89e3.zip |
feat: Add docker support
Diffstat (limited to 'contrib/Dockerfile')
-rw-r--r-- | contrib/Dockerfile | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/contrib/Dockerfile b/contrib/Dockerfile new file mode 100644 index 0000000..d2e3056 --- /dev/null +++ b/contrib/Dockerfile @@ -0,0 +1,35 @@ +# syntax=docker/dockerfile:1 + +FROM golang:1.22-alpine AS builder +RUN apk add --no-cache git make sassc + +WORKDIR /build + +# Download Git submodules +COPY .git ./.git +RUN git submodule update --init --recursive + +# Download Go modules +COPY go.mod go.sum ./ +RUN go mod download +RUN go mod verify + +# Transfer source code +COPY Makefile . +COPY scss ./scss +COPY static ./static +COPY templates ./templates +COPY *.go ./ +COPY pkg ./pkg + +# Build +RUN make + +FROM scratch AS build-release-stage + +WORKDIR /app + +COPY --from=builder /build/cerrado . +COPY contrib/config.docker.scfg /etc/cerrado.scfg + +ENTRYPOINT ["./cerrado"] |