Docker image that allows to run the server Docusaurus
558
I have been looking for a proper documentation server for a very long time and I have to admit that "Docusaurus" is the best solution. It has its flaws, but compared to other products it is really great. You can find more about the tool at https://docusaurus.io/.
In this project I built a Docker image that allows to run the server on address http://localhost:3000/. The project that built this image is located on GitHub.

In image was declared two volumes:
| Localization | Description |
|---|---|
| /webdir/public | Folder. Contains the Docusaurus project. |
| /webdir/.git | Optional! The Git directory is where Git stores the metadata and object database for your project. This is the most important part of Git, and it is what is copied when you clone a repository from another computer. The basic Git workflow goes something like this: You modify files in your working tree. |
For more information about organizing folders in a Docusaurus project, read the documentation pages of Project Structure.
For running the container based on the image you can use docker command:
Before you run the command set properly environment values NMP_VERSION and VOLUME_HOME.
export NMP_VERSION=11.6.0
export VOLUME_HOME=/d/workspace/git/<my-webpage>
docker run --name docusaurus --rm -it \
-v $VOLUME_HOME:/webdir/public \
-p 3000:3000 \
scisoftware/docusaurus:${NMP_VERSION}
The first step is to create a file with the example name sample-compose.yml with the following contents.
Warning
Remember to define volume paths correctly.
networks:
default-network:
driver: bridge
volumes:
webpage:
driver: local
driver_opts:
o: bind
type: none
device: /d/workspace/git/docker-docusaurus/test-folder
services:
my-webpage-sample:
image: scisoftware/docusaurus:latest
networks:
- default-network
environment:
- WORKSPACE_NAME=public
volumes:
- webpage:/webdir/public
ports:
- "3000:3000"
Once the file is created, you can use the following command to run the compositing:
docker compose -f sample-compose.yml up
Before you run the command set properly environment values NMP_VERSION and VOLUME_HOME.
set NMP_VERSION=11.6.0
set VOLUME_HOME=/d/workspace/git/<my-webpage>
docker run --name docusaurus --rm -it `
-v %VOLUME_HOME%:/webdir/public `
-p 3000:3000 `
scisoftware/docusaurus:%NMP_VERSION%
Markdown interpretation differences I found that may affect your decision. So far I've only found the following. I'll publish the differences ASAP as I find them.
In Github you must to use code for tips:
> <p data-quote-type="tip">Tip</p>
> Use this awesome feature option
In Docusaurs you can get the same (or similar) effect by writing:
:::tip My tip
Use this awesome feature option
:::
Docusaurus is a project for building, deploying, and maintaining open source project websites easily.
Source: Githib Docusaurus Project
Content type
Image
Digest
sha256:a937ef9f5…
Size
576 MB
Last updated
12 months ago
docker pull scisoftware/docusaurus