Static Sites
Deploy static sites, SPAs, and JAMstack applications. RailPush runs your build command, then serves the output directory with CDN-optimized caching -- hashed assets are served with immutable 1-year cache headers, while HTML is always fresh. CORS headers are enabled for cross-origin asset loading.
railpush.yaml
services:
- type: static
name: my-site
buildCommand: npm run build
staticPublishPath: dist
envVars:
- key: VITE_API_URL
value: https://api.myapp.com
type: static vs type: web with runtime: static
Both produce a static site, but they work differently:
| Feature | type: static | type: web + runtime: static |
|---|---|---|
| Served by | nginx (optimized static file server) | Nixpacks static buildpack |
| Build step | Runs buildCommand, serves staticPublishPath | Nixpacks detects and builds |
| Best for | Pre-built sites, SPAs (React, Vue, Svelte) | Sites needing Nixpacks auto-detection |
| Recommendation | Preferred for most static sites | Use if you need Nixpacks features |