page:recipes:csv import tool:rails:attachments

Host CSV Import Tool with Rails: File Attachments

Summary

Deploy a CSV import tool built with Rails on Ample using the browser file uploads 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. Verified on Rails: content-type and size validation that rejects disallowed files, an object written to a private bucket and a row linking the record to the object key (reject=ok upload=ok linked=ok). Not separately tested: your upload UI, allowed types, size limits and virus scanning; treat the CSV import tool-specific behavior as your application code.

Representative Queries

Resource Requirements

Infrastructure Requirements

Prerequisites

  1. A Rails project that builds and starts with the documented commands (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).
  2. A PostgreSQL driver reading DATABASE_URL at runtime (auto-provisioned when omitted, or supplied with --env).
  3. A bucket from ample bucket create with its credentials passed as encrypted S3_* environment variables.
  4. An Ample account token with servers:write, databases:read, buckets:read.

Tested Configuration

Workflow Steps

  1. Build and start: Install dependencies and start server with production settings.
  2. Implement the pattern on PostgreSQL: Ensure content-type and size validation is in place and maintain idempotency in migrations.
  3. Wire object storage: Create buckets and set up environment variables for endpoint and credentials.
  4. Deploy: Run a synchronous deploy and check the result.
  5. Verify: Fetch the live URL and run self-tests to confirm functionality.

Examples

Success Checks

Limitations

Cost Estimate