Docusaurus on Kubernetes
Documentation sites, like the one you are reading.
larakube docs:newDocusaurus builds documentation sites into plain files — this site is one. LaraKube CLI runs its dev server with live reload on your machine, and serves the built site from a tiny Caddy image in production.
The Docusaurus scaffolder has not been run end to end yet. Try it, but don't promise it to a client until this badge turns green.
🚀 Create a project
larakube docs:new handbook
LaraKube CLI runs the official create-docusaurus inside a node:24-alpine container and hands you its wizard.
| Flag | What it does |
|---|---|
--template=classic | Pass a create-docusaurus template through and skip its wizard |
--typescript | Use the TypeScript variant, skipping the language prompt |
--fast | Skip the wizard and take classic with TypeScript |
Already have a Docusaurus project?
Run this from its root instead:
larakube init
LaraKube CLI recognises Docusaurus from its Docusaurus config and pre-selects it; pass --framework= to skip the picker. It adds the same Dockerfile.static, Caddyfile and Kubernetes manifests that a new project gets. Add --dry-run to see the list first without writing anything.
🧱 What LaraKube CLI adds
| File | What it does |
|---|---|
Dockerfile.static and Caddyfile | Builds the site inside Docker and serves build/ from Caddy |
.infrastructure/ | Kubernetes manifests: a dev-server pod locally, the Caddy image in the cloud |
Docusaurus has no browser environment-variable prefix; put build-time values in customFields in docusaurus.config.
💻 Run it locally
cd handbook
larakube up
The dev server runs inside the cluster on port 3000. It polls for file changes, because file-change events don't reliably reach a container from a mounted folder on macOS.
☁️ Deploy
larakube env production
larakube cloud:deploy production