Ruby on Rails on Docker with CI/CD
Quick start
Configuration
- Ruby version:
3.1.1
- Rails version:
7.0.2.3
Build project
docker compose build api
Create database
docker compose run --rm api rails db:create
Initialize database
docker compose run --rm api rails db:migrate
Local deployment
docker compose up
go to link
localhost:3000
Health check
go to link
localhost:3000/health_check
### Services
- postgresql:
14.2-alpine
- redis:
7.0-rc-alpine
- sidekiq:
6.4.1
Deploy on Heroku (only on main branch)
- create the next secrets in the github repository
secrets.HEROKU_API_KEY
secrets.HEROKU_API_APP
secrets.HEROKU_API_EMAIL
- create an app on Heroku
heroku create --region us <APP-NAME>
- copy the
<APP-NAME>
toHEROKU_API_APP
- create authorizations
heroku authorizations:create
- copy the Token to
HEROKU_API_KEY
- copy your heroku account email to
HEROKU_API_EMAIL
heroku run rails db:migrate:seed