From 48c28c3e4792dce0b2ff91e43a311bd23fb610a8 Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Mon, 13 Jan 2025 19:53:37 +0100 Subject: [PATCH] apply markdownlint and dockerlint suggestions --- Dockerfile | 2 +- Makefile | 5 +++-- README.md | 26 ++++++++++++++++++-------- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 23e0c0d..55358d4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ WORKDIR /opt/node_app COPY package.json package-lock.json* ./ RUN npm install --verbose --include=dev && npm cache clean --force -ENV PATH /opt/node_app/node_modules/.bin:$PATH +ENV PATH=/opt/node_app/node_modules/.bin:$PATH HEALTHCHECK --interval=30s CMD node healthcheck.js diff --git a/Makefile b/Makefile index e911a35..2c59d99 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,15 @@ #!/usr/bin/make -f +PWD=$(shell pwd) DOCKERRUN=docker run \ --rm -it \ -p 5173:5173 \ --name=naemon-docs \ - -v `pwd`:/opt/node_app/app \ + -v $(PWD):/opt/node_app/app \ -v /opt/node_app/node_modules/ \ -v /opt/node_app/app/.vitepress/cache \ -v /opt/node_app/app/.vitepress/dist \ - -v `pwd`/package.json:/opt/node_app/package.json \ + -v $(PWD)/package.json:/opt/node_app/package.json \ naemon/docs:latest docker-build: diff --git a/README.md b/README.md index cc18d20..e741918 100644 --- a/README.md +++ b/README.md @@ -16,21 +16,21 @@ To do so, all old files got moved into the `legacy` folder using `git mv`. This To migrate a page from Jekyll to VitePress, you have to use the `git mv` command, to move the file from the `legacy` folder into the new VitePress project located in `src`. -``` +```sh git mv legacy/documentation/usersguide/config-incompat3to4.md src/documentation/usersguide/ ``` In the next step, edit the file, apply all the required changes and command your work. - ## Run development server Please see the documentation of how to setup a local copy of the Naemon website. -[Run Naemon Website Locally ](./documentation/developer/website.md) +[Run Naemon Website Locally](./documentation/developer/website.md) ### In a nutshell -``` + +```sh git clone https://github.com/naemon/naemon.github.io.git cd naemon.github.io/ @@ -39,18 +39,29 @@ npm run docs:dev ``` ### Using Docker + In case you do not want to install Nodejs to your system, you can also use Docker First build the Docker image which will contain N Nodejs - thats all this documentation has no dependencies -``` + +```sh docker build . -t naemon/docs ``` Now run the Docker container and navigate to `http://127.0.0.1:5173` in your browser. The container watches for file changes and will automatically regenerate the website if needed. -``` -docker run --rm -it -v "$PWD":/site -p "5173:5173" naemon/docs:latest +```sh +docker run \ + --rm -it \ + -p 5173:5173 \ + --name=naemon-docs \ + -v $PWD:/opt/node_app/app \ + -v /opt/node_app/node_modules/ \ + -v /opt/node_app/app/.vitepress/cache \ + -v /opt/node_app/app/.vitepress/dist \ + -v $PWD/package.json:/opt/node_app/package.json \ + naemon/docs:latest ``` ### Important for the Migration @@ -60,7 +71,6 @@ docker run --rm -it -v "$PWD":/site -p "5173:5173" naemon/docs:latest 3. You can modify HTML anchors like so: `## What Is Naemon? {#whatis}` 4. Add code blocks `like this` for code instead of quotes 'like so'. - ### Goals and Motivation 1. Get a dependency free documentation, (only Nodejs and VitePress) but no GitHub Pages, Jekyll and Ruby anymore.