Create Dockerfile
This commit is contained in:
committed by
GitHub
parent
4349e287c2
commit
c8c4dccace
+25
@@ -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"]
|
||||||
Reference in New Issue
Block a user