Good infrastructure notes answer practical questions: which VLAN carries management traffic, how to restore a service, and what to check after changing a firewall rule.
Docusaurus turns Markdown and MDX files into a static documentation site. You need Node.js and dependencies to build it; the resulting files can be served by a web server without running the Node application in production.
This article combines the two earlier Docusaurus setup posts. It keeps one maintained walkthrough and corrects the earlier claims about built-in local search, automatic Traefik setup, and unconditional deployment times. The configuration below is an example, not a report of a verified deployment in my lab.
Before you begin
Use a development machine with a Node.js version supported by the Docusaurus release you select, npm, and Git. For the container section, you also need Docker Engine and the Docker Compose plugin.
|
|
Check the current installation requirements before scaffolding. The commands intentionally use the current generator for a new project; preserve the resulting lockfile and record the selected versions. They are not a version-pinned reproduction of either original article.
Create and build the project
|
|
Use the development address printed by the command, usually http://localhost:3000. Stop it with Ctrl+C when finished. Do not expose the development server as the production service.
The classic template includes documentation, theme configuration, and example content. Keep its generated presets and configuration structure. JavaScript and TypeScript templates use different filename extensions, so confirm which files were created.
Set the production URL
For a new scaffold, the following replaces the top-level site title, URL and base path. Change docs.example.com to your intended hostname. Back up the generated configuration first:
|
|
These substitutions assume the generator uses the shown two-space indentation and property names. Inspect the printed configuration and confirm all three values changed. For hosting under a subpath, use the appropriate baseUrl instead of / and adjust the web server accordingly.
Build again after configuration changes. Do not replace the entire generated configuration with a fragment for an optional plugin; that can remove the presets which provide the documentation pages.
Write a useful first runbook
Start with one service and a recovery procedure. This creates a new page without replacing the template’s introduction:
|
|
This is a writing template, not an executable recovery procedure. Fill in the service-specific details before anyone relies on it.
With an autogenerated sidebar covering the docs directory, the new page should appear in navigation. If your project uses a manual sidebar, add the document ID runbooks/service-recovery to that existing configuration. A sidebar entry pointing to a nonexistent document can fail the build.
Useful sections for a growing lab include networking, virtualization, services, backups, and runbooks. Keep credentials and recovery keys out of the documentation repository. A static site has no authentication boundary simply because its content feels internal.
Build a static container image
The container uses the Node major version already installed on your development machine. That version must also satisfy the generated project’s requirements. For repeatable releases, pin the build and server images to reviewed versions or digests rather than relying indefinitely on mutable tags.
|
|
These commands create deployment files in the project root. Back up any existing files with those names before adapting this section to an established project. The example assumes npm and an existing package-lock.json; use the matching package manager if you generated the project differently.
The site binds to the Docker host’s loopback address. That is convenient for local testing or a proxy running on the host. A reverse proxy in another container cannot reach it through that container’s own 127.0.0.1.
Verify navigation and missing pages
|
|
Expect the home request to succeed and the invented URL to return 404. Open the runbook through the sidebar, then refresh that page directly. Check navigation and static assets in a browser too. An Nginx syntax check alone does not prove that the generated routes work.
The earlier catch-all /index.html fallback could return the homepage with a successful status for missing routes. This example instead checks generated directory and .html paths before returning a real 404.
Add a reverse proxy deliberately
The loopback deployment does not install Traefik or issue a TLS certificate. To use an existing containerized Traefik deployment, attach the docs container to its shared Docker network, remove the host port mapping if it is unnecessary, and configure a router and service for the docs container’s port 80.
Confirm the proxy’s actual Docker provider, network, entrypoint and certificate-resolver names. Labels copied from a guide do not create those prerequisites. Validate HTTPS and deep links through the real hostname after configuring the proxy.
For a managed static host, deploy the generated build directory instead. Review that host’s build settings and access controls; private repository storage does not automatically make the deployed site private.
Search, diagrams, and versioning
Search needs an integration. Docusaurus does not ship a built-in Lunr search engine just because the classic template or sidebar is enabled. Choose an integration from the search documentation, such as Algolia DocSearch where eligible or a compatible local-search plugin. Confirm plugin compatibility with your Docusaurus release and test the production build, including navigation from a search result.
Mermaid needs configuration. Follow the Mermaid documentation to install the matching theme package and merge its settings into the existing site configuration. A fenced diagram alone does not enable the integration.
Git history and published versions are different. Git records every edit. Docusaurus documentation versioning creates reader-visible snapshots. Introduce snapshots when readers genuinely need multiple supported procedures; avoid creating a new public version for every lab edit. Follow the versioning guide and add the version selector to navigation if you need one.
Publish changes through review
Keep the source, package lockfile, and deployment files in Git. Build proposed changes before merging them, review the rendered site, and deploy the approved revision. Keep the previous working image or deployment available for rollback.
The earlier article included a netcat listener that triggered rebuilds without authenticating webhook requests. Do not use that listener as a deployment mechanism. Use your hosting provider’s Git integration or a CI workflow with deliberately configured deployment credentials and host verification. Deployment time depends on the build, image cache, runner and network; there is no fixed completion time promised here.
Validation limits
This consolidated example has been reviewed for consistency and its Bash blocks can be syntax-checked without running them. It has not been built as a Docusaurus application or deployed against a live Docker host during this update. Check the current upstream requirements, build the generated project, and verify the served pages before adopting it.