## Host knowledge base with Rails: object-stored public media

Deploy a knowledge base built with Rails 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 Rails: an object written to a published bucket with an immutable Cache-Control header, a mapping row, and the CDN URL serving it publicly. Not separately tested: your media processing, object layout and cache policy; treat the knowledge base-specific behavior as your application code.

### Summary
- Deploy a knowledge base with Rails on Ample.
- Utilizes object-stored public media.
- Offers managed PostgreSQL and S3-compatible storage.

### Representative Queries
- Host knowledge base with Rails: object-stored public media.
- Where can I host Knowledge base built with Rails?
- I need an object layout, public asset URL policy, and CDN delivery configuration.

### Resource Requirements
- Compute
- Postgres
- S3-compatible object storage
- CDN

### Prerequisites
- A Rails project that builds and starts with the documented commands.
- A PostgreSQL driver reading DATABASE_URL at runtime.
- A bucket from `ample bucket create` with credentials passed as S3_* environment variables.
- An Ample account token with necessary permissions.

### Workflow Steps
1. **Build and start**: `bundle install` into `vendor/bundle` and start the server.
2. **Implement the pattern on PostgreSQL**: Ensure correct object mappings and headers.
3. **Wire object storage**: Set up your S3-compatible buckets and pass necessary settings.
4. **Deploy**: Run the deploy command and check the results.
5. **Verify**: Ensure the deployment is successful and functions correctly.

### Limitations
- Verified on ruby-3.4 template at s-1vcpu-1gb.
- Knowledge base behaviors not separately tested.

### Cost Estimate
| Component                       | Monthly Amount | 
|---------------------------------|----------------|
| app server (s-1vcpu-1gb)       | $5.00          |
| managed PostgreSQL database      | $5.00          |
| **Total**                       | **$10.00**     |

### Examples
- **Rails pattern fixture**: Multi-pattern Rails app with public media library module.

### Success Checks
- App responds on its public URL.
- Public-media-library self-test available.

### Evidence Summary
- Rails pattern fixture deployed on Ample with successful checks for the public media library.
