Static sites
Use a static app unit when your project builds files and does not need a running app container.
To make an app static, omit the runtime section.
type: appimage: node:22-alpine
builds: - files: ["package.json", "package-lock.json"] script: npm ci
- files: ["*"] env: PUBLIC_API_URL: https://api.example.com script: npm run build
exports: - source: /app/dist path: /Builds run in /app, the container’s working directory, so exports.source points to the build output under it (/app/dist for the example above).
Then serve it with a domain unit:
type: domainserver: nginxhosts: ["example.com"]routes: - kind: serve_files location: / root: ${site:export} spa: trueWhat happens during deploy
Section titled “What happens during deploy”dpl builds the image, copies exported files to the HTTP server state directory, and updates the domain config.
It does not start a service for the static app.
Because there is no runtime:
- no port is available
- no health check runs
- timers are skipped
${site:url}and${site:socket}are not valid${site:export}is valid after the app has an active deployment
To run a service that has no port but still needs a container, keep runtime and omit port instead. See Runtime without a port.
How to use spa
Section titled “How to use spa”Set spa: true in domain settings for apps that need all unknown routes to return index.html.
routes: - kind: serve_files location: / root: ${site:export} spa: trueLeave it false for plain file trees, downloads, and assets.