Static site
This example builds a static site and serves it with nginx.
Static app unit
Section titled “Static app unit”Create <base>/conf/site.yaml:
type: appimage: node:22-alpine
builds: - files: ["package.json", "package-lock.json"] script: npm ci
- files: ["*"] script: npm run build
exports: - source: /app/dist path: /There is no runtime field. dpl builds the site and exports /app/dist.
HTTP server
Section titled “HTTP server”Create <base>/conf/nginx.yaml:
type: http-serverhttp_port: 80https_port: falseDomain
Section titled “Domain”Create <base>/conf/site-domain.yaml:
type: domainserver: nginxhosts: ["example.com"]routes: - kind: serve_files location: / root: ${site:export} spa: trueUse spa: true only if your site needs unknown paths to return index.html.
Deploy
Section titled “Deploy”dpl check site
tar -czf /tmp/site.tar.gz -C path/to/site .dpl deploy site /tmp/site.tar.gzIf you change the static site, rebuild the tarball and redeploy the app:
tar -czf /tmp/site.tar.gz -C path/to/site .dpl deploy site /tmp/site.tar.gz