page:recipes:company website:next js:public media

Host company website with Next.js: object-stored public media

Deploy a company website built with Next.js on Ample using the public media library pattern. Compute runs the app in an isolated microVM behind a public HTTPS URL, a managed PostgreSQL 16 database is auto-provisioned and injected as DATABASE_URL, a private S3-compatible bucket holds objects with credentials delivered as encrypted environment variables, and a published bucket serves public assets from the CDN host. Verified on Next.js: an object written to a published bucket with an immutable Cache-Control header, a mapping row, and the CDN URL serving it publicly.

Summary

Not separately tested: your media processing, object layout and cache policy; treat the company website-specific behavior as your application code.

Representative Queries

Resource Requirements

Infrastructure Requirements

  1. Compute: Apps run in isolated x86_64 Firecracker microVMs.
  2. Postgres: Managed PostgreSQL 16 runs in its own microVM.
  3. S3-compatible object storage: Buckets are S3-compatible with issued credentials.
  4. CDN: The CDN host serves objects from published buckets.

Prerequisites

Workflow Steps

  1. Build and start: next build then next start -H 0.0.0.0 -p $PORT on the node-22 template.
  2. Implement the pattern on PostgreSQL: Copy the approach into your schema; keep migrations idempotent.
  3. Wire object storage: Create the bucket(s), then pass endpoint, region, bucket and keys as --env values.
  4. Deploy: Run the synchronous deploy once and read the result.
    Command: ample deploy . --name --public --env S3_ENDPOINT=... --env S3_REGION=... --env S3_BUCKET=... --env S3_ACCESS_KEY_ID=... --env S3_SECRET_ACCESS_KEY=... --env CDN_PUBLIC_URL=...
  5. Verify: Fetch the live URL and run your own checks.
    Command: ample logs --kind build

Examples

Success Checks

Limitations

Cost Estimate

Next Actions

  1. Browse the catalog index: GET /v1/catalog
  2. Search published recipes: POST /v1/catalog/search
    Body: {"limit":5, "query":"Host company website with Next.js: object-stored public media"}
  3. Prepare a deployment plan: POST /v1/catalog/plan Body: {"inputs":{}, "projectId":"", "recipeId":"page:recipes:company-website:next-js:public-media", "recipeRevision":"r1"}