books/Dockerfile
Djohn 6b6e3f0c15
Some checks failed
books / docker (push) Successful in 10s
books / deploy (push) Failing after 1s
fix: download mdbook binary directly
2026-02-07 11:04:37 +01:00

20 lines
428 B
Docker

# Build stage
FROM alpine:3.19 AS builder
RUN apk add --no-cache curl tar
RUN curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-musl.tar.gz | tar -xz -C /usr/local/bin
WORKDIR /book
COPY book.toml .
COPY src/ src/
RUN mdbook build
# Runtime stage
FROM nginx:alpine
COPY --from=builder /book/book /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]