diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..1d1fe94 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +Dockerfile \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1d9c04e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +ARG GO_VERSION=1.25.3 +FROM golang:${GO_VERSION}-alpine AS build +RUN apk --no-cache add ca-certificates tzdata +WORKDIR /build +COPY go.mod go.sum ./ +RUN go mod download +COPY . . +RUN CGO_ENABLED=0 GOOS=linux go build ./cmd/showbridge + +FROM scratch +COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt +COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo +COPY --from=build /build/showbridge /app/showbridge +ENTRYPOINT [ "/app/showbridge" ] \ No newline at end of file