Docker image for mdbook.
 
 
Go to file
Sofus Albert Høgsbro Rose d08f7691ab
fix: Adapted to gitea infrastructure, new README.
2023-08-13 22:45:03 +02:00
.dockerignore feat: mdbook Docker image. 2023-08-10 16:36:59 +02:00
.gitignore feat: mdbook Docker image. 2023-08-10 16:36:59 +02:00
.pre-commit-config.yaml feat: mdbook Docker image. 2023-08-10 16:36:59 +02:00
Dockerfile feat: Basic working image. 2023-08-13 04:42:53 +02:00
README.md fix: Adapted to gitea infrastructure, new README. 2023-08-13 22:45:03 +02:00
run.py fix: Adapted to gitea infrastructure, new README. 2023-08-13 22:45:03 +02:00

README.md

Containerized mdbook

mdbook (https://rust-lang.github.io/mdBook/) is an easy way to generate beautiful book-like websites from simple Markdown text files. This repository compiles and packages a ready-to-use contianer running mdbook.

Easy Book->Website

mdbook repositories are very clean: Just a src/ folder with a bunch of markdown text files.

docker-mdbook makes it easy to turn that clean bundle of text files into a website deployable as a container. Here's a multi-stage Dockerfile example:

####################
# - Stage: SSG
####################
FROM git.sofus.io/python-support/docker-mdbook:0.1.0 AS base
COPY . /src

RUN mdbook build /src --dest-dir /dist

####################
# - Stage: Serve Static Files
####################
FROM ghcr.io/static-web-server/static-web-server:2
COPY --from=base /dist /app

ENV SERVER_PORT 8787
ENV SERVER_ROOT /app
ENV SERVER_LOG_LEVEL info

USER 5020

Put this Dockerfile in your book repository, then build & run with your favorite container tool:

podman build . --tag mybook:dev
podman run --rm -it -p 8787:8787 mybook:dev
## In your browser, go to localhost:8787

The principle is the same for hot-reloading with ex. mdbook serve.