release: v0.1.0
This commit is contained in:
30
Dockerfile
Normal file
30
Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
# Build stage
|
||||
FROM golang:1.23-alpine AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Cache deps
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
# Copy source and build
|
||||
COPY . .
|
||||
RUN go build -o ddns-updater main.go
|
||||
|
||||
# Runtime stage
|
||||
FROM alpine:latest
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Non-root user (optional)
|
||||
RUN adduser -D ddns
|
||||
USER ddns
|
||||
|
||||
# Copy binary
|
||||
COPY --from=build /app/ddns-updater /usr/local/bin/ddns-updater
|
||||
|
||||
# Config volume
|
||||
VOLUME ["/config"]
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/ddns-updater"]
|
||||
CMD ["-config", "/config/config.yaml"]
|
||||
Reference in New Issue
Block a user