page:guides:sinatra:configuration secrets
Configure environment and secrets for Sinatra
Configuration and secrets for a Sinatra app on Ample. Verified on Sinatra: an --env value delivered encrypted and reported as present without being echoed (secret=set). Build and start: bundle install into vendor/bundle from Gemfile.lock (development and test groups skipped), then Puma via rackup (config.ru) reading PORT on the ruby-3.4 template.
Prerequisites
- A Sinatra project (bundle install into vendor/bundle from Gemfile.lock (development and test groups skipped), then Puma via
rackup(config.ru) reading PORT on the ruby-3.4 template) - An Ample account token with servers:write
Workflow Steps
Build and start
Bundle install into vendor/bundle from Gemfile.lock (development and test groups skipped), then Puma via rackup (config.ru) reading PORT on the ruby-3.4 template; the server must bind 0.0.0.0 on PORT.
Pass values on deploy
Use --env KEY=value (repeatable) or --env-file; values are encrypted at rest and reused on redeploys. Declare names only in ample.toml.
Command: ample deploy . --name --public --env MY_SECRET=...
Verify
Fetch the live URL and /p/configuration-secrets on the example; on failure read the build and runtime logs.
Command: ample logs --kind build
Limitations
- Verified on the ruby-3.4 template at s-1vcpu-1gb; other sizes and Sinatra major versions are not verified.
- Region, compliance attestations and request-duration limits are unknown and not claimed.
Cost Estimate
- Currency: USD
- Monthly Amount: 5.0
- Basis: Size prices from pricing.toml (loaded by the API) at build revision 1ac5595375130d45290090e82ed0f554ccd45405-dirty
- Components:
- App server: s-1vcpu-1gb (Quantity: 1.0, Monthly Amount: 5.0)
- Note: Always-on monthly price of the tested sizes; apps auto-pause when idle.
Success Checks
- App responds on its public URL.
- Configuration-secrets check from the example.
Evidence Summary
- Kind: canary_run
- Summary: Sinatra pattern fixture deployed on Ample; for this guide: an --env value delivered encrypted and reported as present without being echoed (secret=set).
- Observed At: 2026-09-20T23:45:31Z
- Expires At: 2027-03-19T23:45:31Z
Examples
- Title: Sinatra pattern fixture
- Description: Verified configuration and secrets on Sinatra.
- Source Ref: tests/deploy-canaries/sinatra-patterns
Next Actions
- Browse the catalog index: GET /v1/catalog
- Search published recipes by intent, stack and constraints: POST /v1/catalog/search
- Prepare a side-effect-free deployment plan for an authorized project: POST /v1/catalog/plan
- Read the existing agent authentication setup: GET /mcp/setup
- Browse Sinatra: GET /v1/catalog/nodes/stack%3Aframework-sinatra
- Browse Configure deployment: GET /v1/catalog/nodes/intent%3Aconfigure-deployment
- Browse Public web service: GET /v1/catalog/nodes/pattern%3Apublic-web-service