From 5c34ce282590f93bc377018c7bc733ce5313a7ef Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Wed, 2 Oct 2024 19:15:07 +0000 Subject: [PATCH] Dockerfile --- .gitignore | 1 + Dockerfile | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 Dockerfile diff --git a/.gitignore b/.gitignore index 133f18b..b8c3a19 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ !*/ !hash.sh +!Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..204e9e8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM chimeralinux/chimera:latest AS base +RUN apk add go + +FROM base AS builder +WORKDIR /app +COPY . . +RUN go build -ldflags "-s -w" -o diodemail -buildmode=pie ./cmd/server + +FROM base AS runner +WORKDIR /app +COPY --from=builder /app/diodemail ./diodemail + +CMD ["./diodemail"]