All Projects β†’ awesometic β†’ docker-docusaurus

awesometic / docker-docusaurus

Licence: other
A docker image for running Docusaurus 2, which is a development version yet, based on lightweight Alpine Linux.

Programming Languages

shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to docker-docusaurus

support
Your go-to guides for understanding Hashnode a little better.
Stars: ✭ 36 (+71.43%)
Mutual labels:  docusaurus
website
πŸ“ΊVerdaccio documentation website
Stars: ✭ 35 (+66.67%)
Mutual labels:  docusaurus
documentation
Temporal documentation
Stars: ✭ 49 (+133.33%)
Mutual labels:  docusaurus
WEB CodeSquare AmongUs
κ΅° 볡무쀑인 개발자λ₯Ό μœ„ν•œ ꡭ방망용 톡합 개발 ν”Œλž«νΌ
Stars: ✭ 42 (+100%)
Mutual labels:  docusaurus
frontatish
A React native common components kit and helper methods,find the package at this link https://www.npmjs.com/package/frontatish
Stars: ✭ 14 (-33.33%)
Mutual labels:  docusaurus
docker-google-lighthouse-puppeteer
Google Lighthouse + Puppeteer / Docker Image
Stars: ✭ 29 (+38.1%)
Mutual labels:  multiarch
archimedes-docs
Give me a place to stand, and I shall move the earth.
Stars: ✭ 15 (-28.57%)
Mutual labels:  docusaurus
FellowStories
A platform for MLH Fellows to share their stories and experiences
Stars: ✭ 13 (-38.1%)
Mutual labels:  docusaurus
graphql-markdown
Flexible GraphQL Documentation Generator (Markdown)
Stars: ✭ 74 (+252.38%)
Mutual labels:  docusaurus
twoslash
You take some Shiki, add a hint of TypeScript compiler, and πŸŽ‰ incredible static code samples
Stars: ✭ 596 (+2738.1%)
Mutual labels:  docusaurus
rdfshape-api
API for validating and transforming RDF, ShEx, SHACL and more.
Stars: ✭ 31 (+47.62%)
Mutual labels:  docusaurus
remark-admonitions
Add admonitions support to Remarkable
Stars: ✭ 90 (+328.57%)
Mutual labels:  docusaurus
docusaurus-search-local
Offline / Local Search for Docusaurus v2. Try it live at:
Stars: ✭ 203 (+866.67%)
Mutual labels:  docusaurus
Beauty-Saurus
πŸ¦– Beautiful Docusaurus ✨ Easy-Starter ✨ Project
Stars: ✭ 47 (+123.81%)
Mutual labels:  docusaurus
questdb.io
The official QuestDB website, database documentation and blog.
Stars: ✭ 75 (+257.14%)
Mutual labels:  docusaurus
docusaurus-theme-search-typesense
A fork of the awesome @docusaurus/theme-search-algolia library customized to work with Typesense
Stars: ✭ 31 (+47.62%)
Mutual labels:  docusaurus
daloradius-docker
A dockerized Daloradius
Stars: ✭ 21 (+0%)
Mutual labels:  multiarch
mr-pdf
PDF generator of document website
Stars: ✭ 58 (+176.19%)
Mutual labels:  docusaurus
web-analytics-handbook
Handbook - Rendezvous between developers and web data
Stars: ✭ 23 (+9.52%)
Mutual labels:  docusaurus
docker-rpi-plex-video-converter
Raspberry PI - Plex Video converter - Docker image (Multiarch)
Stars: ✭ 19 (-9.52%)
Mutual labels:  multiarch

docker-docusaurus

What is Docusaurus

I'd like to quote the official website.

Docusaurus makes it easy to maintain Open Source documentation websites.

What this project provided for

I hope this project would be useful for those who uses docker for building their server.

Features

Core packages

I chose Alpine Linux for make it a light-weight service. And I did choose node-alpine as its base image for the sake of some tweaks of Node.js version.

So this is composed of,

  • Alpine Linux 3.15
  • Node.js 17.4.0

with,

  • The latest Docusaurus 2 beta comes with automatic updating

Docusaurus 2

This image runs Docusaurus 2 beta instead of stable Docusaurus 1. Docusaurus 2 is developing very actively currently, so I hope that will be released in the near future.

homepage

I saw that there will be some migration jobs needed when a user upgrades their Docusarus 1 to the new Docusaurus 2. So, at this moment I think it is reasonable to use Docusaurus 2 for those who about to start constructing their own website.

But, officially, as this is an beta version yet, I put a automatic update trigger into this image. This can be disabled by setting environment variable like AUTO_UPDATE=false. By default this is enabled.

Keep backing-up your docs

It is highly recommended that always do keeping backing-up your docs. For several reasons such as unexpected physical damage onto your harddrive or software corruptions under development and/or maintenance, you have to back-up your data into your other safe place.

Supports multiple architectures

It builds from Github Actions for supporting multiple architectures such as AMD64(x86_64) and ARM64, ARMv7, ARMv6.

So that you can use this on most computers supporting Docker.

How can I use this

Pull the image from Docker Hub.

docker pull awesometic/docusaurus

Basic usage

You can just do dry-run this with the following command. The '--rm' option removes container when you terminate the interactive session.

docker run -it --rm \
-p 80:80 \
-v /config/dir:/docusaurus \
awesometic/docusaurus

This Docker image requires one mapped volume on host computer.

  • /docusaurus: Where the Docusaurus source files located in

In the first running, it may takes several minutes to download/prepare the whole source code from the Internet. See the When can I access my website chapter below.

Then you have made a basic Docusaurus website having the following characteristics.

  • Project sources are having UID 1000 and GID 1000 for non-root editing
  • Enabled auto update
  • Named "MyWebsite"
  • Styled with "classic" template

If you want to run this image as a daemon with your parameters, try using the following command.

docker run -d --name=docusaurus \
-p 80:80 \
-v /config/dir:/docusaurus \
-e TARGET_UID=1000 \
-e TARGET_GID=1000 \
-e AUTO_UPDATE=true \
-e WEBSITE_NAME="awesometic-docs" \
-e TEMPLATE=classic \
awesometic/docusaurus

When the container runs, just let your browser browses:

http://localhost/

Production mode

This image runs in development mode by default so that you can see the changes right after you edit the documents.

But you can build the source files by starting this image as production mode. You can do this by adding the RUN_MODE environment variable when you create a container. See the commands below.

docker run -d --name=docusaurus \
-p 80:80 \
-v /config/dir:/docusaurus \
-e TARGET_UID=1000 \
-e TARGET_GID=1000 \
-e AUTO_UPDATE=true \
-e WEBSITE_NAME="awesometic-docs" \
-e TEMPLATE=classic \
-e RUN_MODE=production \
awesometic/docusaurus

Then the logs shows like the below.

/* Will run this Node service as production mode... */
/* Build current sources... */
yarn run v1.22.15
$ docusaurus serve --build --port 80 --host 0.0.0.0
2021-10-21 07:18:25,121 INFO success: docusaurus entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

[en] Creating an optimized production build...
β„Ή Compiling Client
β„Ή Compiling Server
βœ” Client: Compiled successfully in 12.17s
βœ” Server: Compiled successfully in 14.75s
Success! Generated static files in "build".

Use `npm run serve` command to test your build locally.


   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚                                                        β”‚
   β”‚   Serving "build" directory at "http://0.0.0.0:80/".   β”‚
   β”‚                                                        β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

If the build is completed flawlessly, you can find the build directory under the directory you selected for the website sources of the Docusaurus service.

The built-in web server serves built web sources but you also can serve that from the other web servers like Nginx or Apache.

The built files will be updated to have the latest contents whenever you enter the docker restart [container-id] command.

When can I access my website

In the first running, so to speak, if it ran without configuration files that are created during the first run time before, the users cannot access the newly created Docusaurus website immediately. It will take more than 1 minutes because it downloads the latest Docusaurus source codes at the init process.

See the logs showing when the Docusaurus container runs.

Variables:
        - UID=1000
        - GID=1000
        - AUTO_UPDATE=true
        - WEBSITE_NAME=awesometic-docs
        - TEMPLATE=classic
        - RUN_MODE=development
/* Register a new cron job for auto updating... */
/* Successfully registered. */
/* Install docusaurus... */
npm WARN exec The following package was not found and will be installed: @docusaurus/init@latest

Creating new Docusaurus project ...
...
[4/4] Building fresh packages...
...
Success! Created awesometic-docs
...
/* Node modules already exist in /docusaurus/awesometic-docs/node_modules */
/* Start supervisord to start Docusaurus... */
2021-02-22 03:14:43,572 INFO Set uid to user 0 succeeded
2021-02-22 03:14:43,584 INFO supervisord started with pid 95
2021-02-22 03:14:44,589 INFO spawned: 'docusaurus' with pid 97
yarn run v1.22.5
$ docusaurus start --port 80 --host 0.0.0.0
2021-02-22 03:14:46,406 INFO success: docusaurus entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Starting the development server...
Docusaurus website is running at: http://localhost:80/
β„Ή Compiling Client
β„Ή ο½’wdsο½£: Project is running at http://0.0.0.0:80/
β„Ή ο½’wdsο½£: webpack output is served from /
β„Ή ο½’wdsο½£: Content not from webpack is served from /docusaurus/awesometic-docs
β„Ή ο½’wdsο½£: 404s will fallback to /index.html
βœ” Client: Compiled successfully in 27.42s
β„Ή Compiling Client
βœ” Client: Compiled successfully in 507.94ms

As we can see the logs, at the first, the init process is downloading the full source codes from the Internet. Then it builds the source codes, and finally it starts with the specified port number. At this moment the logs are,

$ docusaurus start --port 80 --host 0.0.0.0
2021-02-22 03:14:46,406 INFO success: docusaurus entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Starting the development server...
Docusaurus website is running at: http://localhost:80/
β„Ή Compiling Client
β„Ή ο½’wdsο½£: Project is running at http://0.0.0.0:80/
β„Ή ο½’wdsο½£: webpack output is served from /
β„Ή ο½’wdsο½£: Content not from webpack is served from /docusaurus/awesometic-docs
β„Ή ο½’wdsο½£: 404s will fallback to /index.html
βœ” Client: Compiled successfully in 27.42s
β„Ή Compiling Client
βœ” Client: Compiled successfully in 507.94ms

So, even if you cannot access it after running this Docker image, the container itself maybe not broken. Wait 1 or 2 minutes, then you can see the website front.

Remains

  • Production mode - Currently, this image always runs Docusaurus as development mode. The development mode allows live-updated as the admin edits whose site but it is not that solid because the visitors also can see the 'being editing' contents. This is acceptable for now but the production mode will be added on the requests.
  • Support HTTPS - This image doesn't support SSL even if the generated cert files are preprared but you can apply SSL if you have external Let's Encrypt program and/or a reverse proxy server like "linuxserver/letsencrypt".

License

This project comes with MIT license. Please see the license file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].