Files
go-ubuntu-mirror/Dockerfile
2025-10-21 07:19:06 +02:00

18 lines
466 B
Docker

FROM golang:1.25-alpine AS build
WORKDIR /src
ENV CGO_ENABLED=0
RUN apk add --no-cache ca-certificates
COPY go.* ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /out/mirrorweb
FROM alpine:3.22
RUN apk add --no-cache ca-certificates tzdata && update-ca-certificates
RUN addgroup -S app && adduser -S -G app app
USER app
WORKDIR /
VOLUME ["/data"]
EXPOSE 8080
COPY --from=build /out/mirrorweb /mirrorweb
ENTRYPOINT ["/mirrorweb"]