Skip to content
Snippets Groups Projects
Commit 48a92a81 authored by Jan Frenzel's avatar Jan Frenzel
Browse files

Added information about how to use the Dockerfile to serve the

documentation.
parent 8750e138
No related branches found
No related tags found
3 merge requests!322Merge preview into main,!319Merge preview into main,!211Added information about how to use the Dockerfile to serve the documentation.
......@@ -109,6 +109,30 @@ INFO - Start watching changes
Open `http://127.0.0.1:8000` with a web browser to preview the local copy of the documentation.
#### Preview Using mkdocs With Dockerfile
You can also use `docker` to build a container from the `Dockerfile`, if you are familiar with it.
This may take a while, as mkdocs and other necessary software needs to be downloaded.
Building a container with the documentation inside could be done with the following steps:
```Bash
cd /PATH/TO/hpc-compendium
docker build hpc-compendium .
```
**Note:** Whenever you change the documentation, you need to rebuild the container, so that
recent changes are included in the container.
Afterwards, inspect the output. `mkdocs` was automatically invoked to build the documentation,
so it should have given some information if some things were not as expected.
If you want to see how it looks in your browser, you can use shell commands to serve
the documentation (first line) and get the URL for your browser's address bar (second line):
```Bash
docker run -it hpc-compendium mkdocs serve -a 0.0.0.0:8000
docker inspect `docker ps | grep hpc-compendium | cut -d' ' -f1` | sed -n '/\<IPAd/s#^.*"\([0-9.]*\)".*$#http://\1:8000#p' | head -n1
```
#### Build Static Documentation
To build the documentation, invoke `mkdocs build`. This will create a new directory named `public`
......
  • Martin Schroschk @mflehmig--tu-dresden.de ·
    Owner

    Hi Jan, thanks for contributing. What are the benefits to use docker on a local machine for a frequently updated documentation?

  • Jan Frenzel @s2817051--tu-dresden.de ·
    Author Maintainer

    Using docker, we can avoid installing Python and npm packages on the local system. This is independent from documentation updates. I initially intended to also run the linter, but this did not work as described. Feel free to add some description.

  • Martin Schroschk @mflehmig--tu-dresden.de ·
    Owner

    As far as I understand your contributed documentation, one needs to rebuild the container with every update/commit in the repository, right?

  • Jan Frenzel @s2817051--tu-dresden.de ·
    Author Maintainer

    I reused the Dockerfile which was already available. It seems to copy the data instead of mounting it. Thus, the documentation is only copied whenever the container is built.

  • Bert Wesarg :keyboard: @wesarg--tu-dresden.de ·
    Maintainer

    why not mount the repo into the docker, instead of copying it over and over again?

  • Martin Schroschk @mflehmig--tu-dresden.de ·
    Owner

    @rotscher--tu-dresden.de, is Bert's suggestion possible and a good idea with respect to deployement pipeline?

    Or do we have to distinguish two scenarios:

    1. Using docker for CI/Cd pipeline and deployment
    2. Using docker on local host for development (updating documentation sites) and running markdown linter and link checker.
  • Danny Marc Rotscher @rotscher--tu-dresden.de ·
    Owner

    Yes, mounting the repo into the Docker container would be better. It could also be possible to use the Docker container for local deployment.

  • Jan Frenzel @s2817051--tu-dresden.de ·
    Author Maintainer

    I have added a volume to the Dockerfile. However, to not affect any build pipelines, I did not touch the copying. The README.md shows how to mount the directory or use lint/link check. However, I need your guidance, whether I should leave it, where it is, or replace some of the README.md sections.

  • Danny Marc Rotscher @rotscher--tu-dresden.de ·
    Owner

    Sorry, currently I try to fix a bigger bug with DCV on Taurus, I will came back to that issue, when I solved the problem.

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment