> ## Documentation Index
> Fetch the complete documentation index at: https://www.towbar.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Static site

> Build browser assets and serve them from a pinned runtime image.

Choose `static` when the output is HTML, JavaScript, CSS, and other files rather than a long-running application process. Towbar runs `buildCommand` in the source context and serves the `output` directory.

## Example manifest

This is the validated example from the Towbar `examples/platform-modes` project. Replace the documentation IP, domain, and image choices with values for your environment.

```yaml title=".towbar/apps/static.app.yml" theme={"system"}
id: static-example
name: Static example
deployment:
  type: static
  context: examples/platform-modes/static
  output: dist
  buildCommand: [node, build.mjs]
  architecture: amd64
  cache:
    enabled: true
    scope: platform-static-example
  nodeImage: node:24-alpine@sha256:50c8e8ca1d27439048670df5883f32d57cf81cff6233222c893fd0d9884cbd81
  runtimeImage: nginxinc/nginx-unprivileged@sha256:27985295bdb22a1ef8f712863210bd5877c0f3006494a593e86b3fe0fa55467e
  spaFallback: true
  headers:
    Cache-Control: public, max-age=300
    X-Content-Type-Options: nosniff
container:
  port: 8080
health:
  path: /
environments:
  production:
    server: 192.0.2.10
```

## Configure it

The example uses a pinned Node build image and pinned nginx runtime image. `spaFallback` serves the entry page for client-side routes; `headers` adds response headers. Set `container.port` to the runtime image's listen port, not the build tool's port.

Keep the output path inside the context and verify it exists after the command finishes. Static and Dockerfile builds can use protected build values; do not bake credentials into generated browser assets.

Map the named environment to a branch, register and prepare its server, then sync the repository. Start with a manual deployment and verify the running service before opting into automation. See [Application manifest](/docs/apps/manifest) for shared fields and [Deployment modes](/docs/platform-deployments) to compare modes.
