Sign inSign up

scisoftware/docusaurus

By scisoftware

Updated 12 months ago

Docker image that allows to run the server Docusaurus

Image
Developer tools
Web servers
0

558

scisoftware/docusaurus repository overview

Docusaurus

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/.

About project

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. http://localhost:3000/

Volumes declared in image

In image was declared two volumes:

LocalizationDescription
/webdir/publicFolder. Contains the Docusaurus project.
/webdir/.gitOptional! 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.

Run image

For running the container based on the image you can use docker command:

Linux

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}
Linux - docker compose

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
Windows, PowerShell

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%

The main differences between Github and Docusaurs

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.

Tips

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

:::

About Docusaurus

Docusaurus is a project for building, deploying, and maintaining open source project websites easily.

Source: Githib Docusaurus Project

Sources

Tag summary

Content type

Image

Digest

sha256:a937ef9f5

Size

576 MB

Last updated

12 months ago

docker pull scisoftware/docusaurus