Feature request
Add Dockerfile and docker-compose.yml to the repo root or within subfolder docker to support
running the built site as a self-contained container.
This feature is not intented for aiming local development (native cargo xtasks serve is enough), but it would introduce an alternative deployment method without relying on github.io upstream. The simplest solution is building a container which wraps cargo xtasks serve as a service. Another option is using an external image which hosts /docs page after cargo xtasks deploy command
A possible solution
- Multi-stage
Dockerfile:
- Builder stage:
rust:1-slim-bookworm, installs mdbook + mdbook-mermaid,
builds xtask in release mode.
- Runtime stage:
debian:bookworm-slim, copies only the built binaries
(xtask, mdbook, mdbook-mermaid) — no Rust toolchain in the final image.
CMD ["xtask", "serve"], binds 0.0.0.0:3000 via XTASK_BIND env var.
docker-compose.yml exposing port 3000, with a healthcheck against the
running server and restart: unless-stopped.
This solution is temporary and can be improved. If the feature is interesting, I would be happy to open a PR with the implemented integration.
Feature request
Add
Dockerfileanddocker-compose.ymlto the repo root or within subfolderdockerto supportrunning the built site as a self-contained container.
This feature is not intented for aiming local development (native
cargo xtasks serveis enough), but it would introduce an alternative deployment method without relying on github.io upstream. The simplest solution is building a container which wrapscargo xtasks serveas a service. Another option is using an external image which hosts/docspage aftercargo xtasks deploycommandA possible solution
Dockerfile:rust:1-slim-bookworm, installsmdbook+mdbook-mermaid,builds
xtaskin release mode.debian:bookworm-slim, copies only the built binaries(
xtask,mdbook,mdbook-mermaid) — no Rust toolchain in the final image.CMD ["xtask", "serve"], binds0.0.0.0:3000viaXTASK_BINDenv var.docker-compose.ymlexposing port3000, with a healthcheck against therunning server and
restart: unless-stopped.This solution is temporary and can be improved. If the feature is interesting, I would be happy to open a PR with the implemented integration.