FROM golang:1.22 as build WORKDIR /build COPY . . RUN wget https://github.com/rust-lang/mdBook/releases/download/v0.4.37/mdbook-v0.4.37-x86_64-unknown-linux-gnu.tar.gz RUN tar xvf mdbook-v0.4.37-x86_64-unknown-linux-gnu.tar.gz RUN ./mdbook build RUN CGO_ENABLED=0 go build -ldflags "-w -s" docker/serve.go FROM gcr.io/distroless/static-debian12:nonroot WORKDIR /app COPY --from=build /build/serve . COPY --from=build /build/book/ static/ EXPOSE 3000 CMD ["/app/serve"]