From f4ad355a0e25b4aadc4275e68823c03082087d5e Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Mon, 8 Jul 2024 10:19:37 +0100 Subject: [PATCH] Use docker compose to simplify dev and build --- .gitignore | 1 + README.md | 11 +++++++++-- docker-compose.yml | 9 +++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 docker-compose.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..1320f90e5 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +site diff --git a/README.md b/README.md index 087aac27b..6fb779d73 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,7 @@ might remain and need fixed. ### Local dev ``` -docker build -t deluge-mkdocs . -docker run --rm -it -p 8000:8000 -v ${PWD}:/docs deluge-mkdocs +docker compose up ``` Open browser at http://localhost:8000 @@ -24,6 +23,14 @@ Live reloading will refresh the served pages modifying mkdocs.yml and markdown pages. Changes to any `overrides` files requires restarting docker server. +### Build site + +``` +docker compose run mkdocs build +``` + +The build output will be in `site` directory. + ### Override home and header The `overrides` directory contains the files to set a custom homepage diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..a0ba3e390 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +services: + mkdocs: + container_name: mkdocs + build: . + restart: always + ports: + - "8000:8000" + volumes: + - "${PWD}:/docs"