## Deliver public assets through CDN for Rails

Cdn assets for a Rails app on Ample. Verified on Rails: a versioned, immutable-cached asset uploaded to a published bucket and served from the CDN URL. Build and start: bundle install into vendor/bundle from Gemfile.lock (development and test groups skipped), then Puma via `rails server` reading PORT on the ruby-3.4 template with RAILS_ENV=production.

### Representative Queries
- Deliver public assets through CDN for Rails
- Where can I host Deliver public assets through CDN built with Rails?
- I need a public-origin configuration, versioned asset build and observable cache behavior.

### Resource Requirements
- **Compute:** Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request; sizes are the priced VM sizes.
- **CDN:** The CDN host serves objects from published buckets. It does not front app compute and is not a cache or key-value store.

### Prerequisites
- A Rails project (bundle install into vendor/bundle from Gemfile.lock (development and test groups skipped), then Puma via `rails server` reading PORT on the ruby-3.4 template with RAILS_ENV=production)
- A bucket from `ample bucket create` with credentials passed as encrypted S3_* environment variables
- An Ample account token with servers:write, buckets:read

### Workflow Steps
1. **Build and start**: bundle install into vendor/bundle from Gemfile.lock (development and test groups skipped), then Puma via `rails server` reading PORT on the ruby-3.4 template with RAILS_ENV=production; the server must bind 0.0.0.0 on PORT.
2. **Publish a bucket for public assets**: Publish only the asset bucket; upload versioned keys with an immutable Cache-Control header and build URLs from its public URL.
   - Command: `ample bucket publish`
3. **Verify**: Fetch the live URL and /p/versioned-static-assets on the example; on failure read the build and runtime logs.
   - Command: `ample logs  --kind build`

### Cost Estimate
- **Currency**: USD
- **Monthly Amount**: 5.0
- **Basis**: size prices from pricing.toml 
- **Components**:
  - **App server**: size `s-1vcpu-1gb`, quantity `1.0`, monthly amount `5.0`

### Limitations
- Verified on the ruby-3.4 template at s-1vcpu-1gb; other sizes and Rails major versions are not verified.
- Region, compliance attestations and request-duration limits are unknown and not claimed.
- The CDN serves published-bucket objects only; cache rules, purge and TTL control are not verified.

### Success Checks
- **App responds on its public URL**: Expect response on `/` with `ample canary rails patterns`
- **Versioned-static-assets check from the example**: Expect response on `/p/versioned-static-assets` to see the pattern fixture checks.

### Example
- **Rails pattern fixture**: Verified CDN assets on Rails. Source: `tests/deploy-canaries/rails-patterns`.

### Evidence Summary
- **Summary**: Rails pattern fixture deployed on Ample. Implemented as described above with versioned, immutable-cached assets.
- **Observed At**: 2026-09-20T21:55:28Z
- **Last Verified At**: 2026-09-20T21:55:28Z

### Next Actions
- **Browse the catalog index**: `GET /v1/catalog`
- **Search published recipes**: `POST /v1/catalog/search` with body `{ "limit": 5, "query": "Deliver public assets through CDN for Rails" }`
- **Prepare a side-effect-free deployment plan**: `POST /v1/catalog/plan` with appropriate body inputs.
