Ruby / Rails
Prerequisites
- Dependencies managed by bundler, via
Gemfile
Optional configuration
- Specify a web process with a
Procfile
Add a database
Options for AWS-managed database add-ons include RDS MySQL and Postgres.
By default the connection and authnetication details are sent to the app via the environment variable DATABASE_URL, which Rails handles automatically by default.
Sqlite
To use Sqlite you can add-on an EFS volume, mounted on /workspace/sqlite and then point to it by setting the env var:
$ tapit set variable DATABASE_URL sqlite3:///workspace/sqlite/production.dbSet environment variables
$ tapit set variable SECRET_KEY_BASE `bundle exec rails secret` secret=yesMigrate database
To run commands interactively at a shell prompt:
$ tapit run bashTo create a background task (without console interactions, ideal for scripting) for DB migration:
$ tapit create task 'bundle exec rake db:setup'`
$ tapit create task 'bundle exec rake db:migrate'`