From c8c4dccace6ddd63c22b71ed61544c5c7ac76f55 Mon Sep 17 00:00:00 2001 From: Christian Krakau-Louis Date: Tue, 18 Feb 2025 15:29:00 +0100 Subject: [PATCH] Create Dockerfile --- Dockerfile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..31e095c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +# Build stage using an official Go image. +FROM golang:1.20 AS builder + +WORKDIR /app + +# Copy the source code and directories. +COPY . . + +# Build the binary. +RUN CGO_ENABLED=0 go build -o dynamic_dns_server . + +# Final minimal image. +FROM alpine:latest + +WORKDIR /root/ + +# Copy the binary and the ssl & webroot directories. +COPY --from=builder /app/dynamic_dns_server . +COPY --from=builder /app/ssl ./ssl +COPY --from=builder /app/webroot ./webroot + +# Expose the port (default 443). +EXPOSE 443 + +ENTRYPOINT ["./dynamic_dns_server"]