From 385586d383acd0868ace3f5da2094dd87c1b89e3 Mon Sep 17 00:00:00 2001 From: Marco Andronaco Date: Sat, 5 Oct 2024 21:36:05 +0200 Subject: feat: Add docker support --- contrib/Dockerfile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 contrib/Dockerfile (limited to 'contrib/Dockerfile') 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"] -- cgit v1.2.3