Skip to main content

Vite on Kubernetes

Vite logoVite logo

React, Vue, Svelte or Solid single-page apps.

larakube vite:new
🟡 Not yet verifiedNo backing services to shareTypeScriptScaffolds via official CLI

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

Not yet verified

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.

FlagWhat it does
--template=react-tsPass a create-vite template through and skip its wizard
--pm=pnpmPackage manager: npm (default), pnpm, bun or yarn
--fastSkip 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

FileWhat it does
Dockerfile.static and CaddyfileBuilds 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

➡️ Next