Vite on Kubernetes
React, Vue, Svelte or Solid single-page apps.
larakube vite:newA Vite app is a folder of built files with no server of its own. LaraKube CLI runs Vite's dev server with hot reload on your machine, and serves the built bundle from a tiny Caddy image in production.
The Vite scaffolder has not been run end to end against this checklist yet. Try it, but don't promise it to a client until this badge turns green.
🚀 Create a project
larakube vite:new dashboard
LaraKube CLI runs the official create-vite inside a node:24-alpine container, so you don't need Node on your machine, and hands you its wizard to pick React, Vue, Svelte, Solid or another template.
| Flag | What it does |
|---|---|
--template=react-ts | Pass a create-vite template through and skip its wizard |
--pm=pnpm | Package manager: npm (default), pnpm, bun or yarn |
--fast | Skip the wizard and take the react-ts template |
Already have a Vite project?
Run this from its root instead:
larakube init
LaraKube CLI recognises Vite from its Vite 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 bundle inside Docker and serves dist/ from Caddy |
.infrastructure/ | Kubernetes manifests: a dev-server pod locally, the Caddy image in the cloud |
Variables the browser needs must start with VITE_, so Vite compiles them into the bundle.
🔌 A backend, if you want one
A static site has no database of its own, so there's nothing to share in the Plex Commons. When your app needs data, connect a PocketBase or Directus instance running on the same cluster:
larakube data:wire
💻 Run it locally
cd dashboard
larakube up
Vite's dev server runs inside the cluster on port 5173, with hot reload.
☁️ Deploy
larakube env production
larakube cloud:deploy production