Console
Products
Markdown

Workers & Static Sites

Run HTTP servers in isolated Nitro Sandboxes (Node, Python, or static Linux binaries) or serve static sites directly from CloudFront and S3.

A Worker is either a long-running HTTP server inside an AWS Nitro Sandbox or a static site served from S3 through CloudFront with zero compute and zero cold starts.

#Runtimes

RuntimeFlagEntry pointNotes
Node--runtime nodemain in package.json or index.jsNode LTS, listens on PORT, NODE_ENV=production.
Python--runtime pythonmain.py at bundle rootPython 3.14, PYTHONUNBUFFERED=1, vendor deps in .packages/ (musllinux wheels for aarch64).
Static binary--runtime binaryExecutable main at bundle rootStatic aarch64 Linux binary (e.g., Rust aarch64-unknown-linux-musl or Go CGO_ENABLED=0 GOARCH=arm64).
Static site--runtime staticBuilt files at bundle rootUnpacked to S3 at deploy with Brotli/gzip copies; served via CloudFront.

#Bundle Rules & Environment

  • Archives (.tar.gz) can be up to 64 MiB compressed (512 MiB and 100,000 entries unpacked).
  • The bundle mounts read-only at /app. /tmp is a writable 1 GiB scratch disk cleared on every cold start.
  • The platform injects PORT, MH_WORKER, MH_DEPLOYMENT, SKOPIK_BINDINGS_URL, and MH_BINDINGS_URL.
  • Precedence: platform variables → Worker secrets → .env file in bundle.

#Scaling, Memory & Warm Instances

Instances start on demand and stop after 5 minutes of idle time (open streams and WebSockets keep an instance active). You can configure memory_mib (256, 512, or 1024; default 256) and min_instances (0 to 4; default 0) to keep production warm:

bash
skopik update_worker --worker api --memory-mib 512 --min-instances 1

#Immutable Deployments, Aliases & Rollback

Every deploy creates an immutable deployment with its own URL. Named aliases (production, or preview aliases like feat-login) point at a deployment:

  • Deploy to a preview alias: skopik deploy --worker api --alias feat-login
  • Instant rollback: skopik rollback --worker api moves the alias back to its previous deployment.
  • CDN caching: Worker responses with a cacheable Cache-Control header are cached at CloudFront automatically.

#Static Sites

Deploy a built frontend directory with --runtime static:

bash
skopik deploy --dir dist --worker web --runtime static

Configure SPA routing, clean URLs, custom 404 pages, and per-path Cache-Control rules in skopik.json:

json
{
  "static": {
    "spa": true,
    "clean_urls": true,
    "not_found": "404.html",
    "cache_control": [
      { "path": "/assets/*", "value": "public, max-age=31536000, immutable" }
    ]
  }
}