Database provided by Google Cloud SQL.
Edit the docker-compose.yml
file to include the RAILS_MASTER_KEY
environment variable (they are different between development and production).
docker-compose build
docker-compose up
- Go to Cloud Build settings and make sure the service account has Cloud Run is enabled.
- Enable Cloud Run API.
- Enable Cloud Resource Manager API.
- Enable the SQL Admin API.
- Connect Cloud Build trigger to github repo and set the following substitution variables:
- _REGION
- _RAILS_ENV
- _RAILS_MASTER_KEY
- Push to your github repo
This sort of app can be created completely on Docker:
- Copy the Dockerfile and docker-compose.yml files.
docker-compose build
docker-compose run app bash
gem install rails
cd .. && rails new app
bundle exec rake webpacker:install
yarn install --check-files
- Set production secret_key_base:
rails credentials:edit --environment production
rails generate controller Home index
- Add
root 'home#index
to routes.rb