Add a Dockerfile

This commit is contained in:
Markus Unterwaditzer
2025-09-16 15:12:48 +02:00
committed by Catherine
parent 9c0cdaa2eb
commit bffa79dfba
2 changed files with 27 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
FROM golang:1.24-alpine AS builder
RUN apk add --no-cache git
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY src/ ./src/
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o git-pages ./src
FROM alpine:latest
RUN apk --no-cache add ca-certificates git
RUN addgroup -g 1000 -S appuser && \
adduser -u 1000 -S appuser -G appuser
WORKDIR /app
COPY --from=builder /app/git-pages .
USER appuser
EXPOSE 3333
CMD ["./git-pages"]