# https://docs.docker.com/guides/golang/build-images/ # syntax=docker/dockerfile:1 # Build the application from source FROM golang:1.24.3 AS build-stage WORKDIR /app COPY go.mod go.sum ./ RUN go mod download COPY cmd /app/cmd/ COPY internal /app/internal/ RUN GIN_MODE=release CGO_ENABLED=1 GOOS=linux go build -o /CatsOfMastodonGo ./cmd/CatsOfMastodonBotGo/main.go # Deploy the application binary into a lean image FROM gcr.io/distroless/base-debian12 AS build-release-stage WORKDIR / COPY --from=build-stage /CatsOfMastodonGo /CatsOfMastodonGo COPY --from=build-stage /app/internal/web/templates /internal/web/templates EXPOSE 8080 ENTRYPOINT ["/CatsOfMastodonGo"]