Skip to content

Static Sites ​

Zenavo serves static sites with Caddy on port 8080, built from your repository on every deploy.

Plain HTML ​

A repository with index.html and no package.json is detected as static: its files are served as they are.

Built sites (Vite, React, Vue, Svelte, Astro) ​

A Node.js project whose framework builds to static files, such as Vite, Create React App, Vue, SvelteKit with the static adapter or Astro, is built with its build script and the output folder is served. zbpack knows each framework's folder (dist for Vite, build for Create React App); the Build Plan Preview shows it as outputDir. For another folder, set it under Settings → Build → zbpack options:

sh
ZBPACK_OUTPUT_DIR=public

Single-page apps ​

Client-side routers (React Router, Vue Router) work without settings: a path without a file extension that matches no file returns index.html, while a missing asset such as /assets/app.js still returns 404.

Variables in static sites ​

A static site has no server, so its variables, such as Vite's VITE_* (import.meta.env.VITE_API_URL) or Create React App's REACT_APP_*, must be there when it is built. Variables on the Variable tab are given to the running service only, so set these under Settings → Build → Build arguments instead, for example:

sh
VITE_API_URL=https://api.example.com

They reach the build without a Dockerfile; see build arguments. With your own Dockerfile, declare each with an ARG line before the build command. Everything in the bundle is public: never put secrets in these variables.

Deploy ​

  1. Add Service → GitHub, pick the repository and branch.
  2. Click Next, check the preview shows static or nodejs with your framework and output folder, and click Deploy.
  3. Generate a domain on the Networking tab, or bind your own.

Other generators ​

For Hugo, Jekyll, MkDocs or a generator zbpack does not know, either commit the built output and set ZBPACK_OUTPUT_DIR to it, or add a Dockerfile that builds the site and serves it:

dockerfile
FROM hugomods/hugo:exts AS build
WORKDIR /src
COPY . .
RUN hugo --minify

FROM caddy:2-alpine
COPY --from=build /src/public /usr/share/caddy
EXPOSE 80

Common problems ​

SymptomCause
Reloading a page other than / returns 404Your own Dockerfile serves the site with a server that has no fallback to index.html. Use try_files {path} /index.html in Caddy, or the generated build.
The site is blank and the console shows 404s for assetsThe build's base path is not /. Check base in vite.config or homepage in package.json.
A VITE_* value is undefinedIt is set on the Variable tab only, which does not reach the build. Set it as a build argument and redeploy; with your own Dockerfile, also declare it with ARG.

Not affiliated with Zeabur.