2024-02-14 19:00:32 +01:00
|
|
|
# Build
|
2024-08-13 22:40:07 +02:00
|
|
|
FROM golang:1.23 AS build
|
2024-02-14 19:00:32 +01:00
|
|
|
|
|
|
|
WORKDIR /build
|
|
|
|
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
RUN go mod download
|
|
|
|
|
|
|
|
COPY static/ ./static
|
|
|
|
COPY templates/ ./templates
|
2024-05-11 01:05:09 +02:00
|
|
|
COPY main.go ./
|
|
|
|
COPY internal/ ./internal
|
2024-02-14 19:00:32 +01:00
|
|
|
|
2024-05-11 01:05:09 +02:00
|
|
|
# Enable static binary, target Linux, remove debug information and strip binary
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-w -s"
|
2024-02-14 19:00:32 +01:00
|
|
|
|
|
|
|
# Copy to our image
|
|
|
|
FROM gcr.io/distroless/static-debian12:nonroot
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY --from=build /build/plakken ./
|
|
|
|
|
|
|
|
ENV PLAKKEN_LISTEN ":3000"
|
|
|
|
|
|
|
|
EXPOSE 3000/tcp
|
|
|
|
|
2024-05-11 01:05:09 +02:00
|
|
|
ENTRYPOINT ["/app/plakken"]
|