Easy Rails on Kubernetes approach for Digital Ocean and a classic Rails stack: Puma, Redis, Sidekiq, Postgres, Action Cable, Webpacker. Helm 3 in production and docker-compose + dip (https://github.com/bibendi/dip) in development. Issues and PRs welcome.
:construction: This setup is a work in progress :construction:
An attempt at creating a standardized Docker/Kubernetes-Helm/GitHub Actions setup for use with Rails projects. A version of this setup (that is little bit further ahead) is now used in production for services available to Le Wagon teachers, students, and alumni.
A standard Action Cable chat application (Rails 6 + Stimulus) that uses twitter-text gem to extract free-formed URLs out of text and generate Open Graph previews for links. The dependency was chosen consciously, as it requires an external system library to function (
libidn11), which makes it a perfect case for Docker.
It requires Sidekiq, Redis, and PostgreSQL to run, which represents the standard deployment stack of production Rails apps.
git push origin masteror a PR merge on GitHub
By constantly migrating legacy applications to this setup and starting new ones with the same setup in mind we make sure that all common production bugs will be squashed before we can fully automate the generation of charts and configuration.
gem install dip
dip provisionto build all necessary images and setup the local DB
dip up -dto run all services in the background:
webpack-dev-serverfor JS live reload),
redis. Go to
dip rails cto visit console.
dip downto stop the music and go home.
If you need to change project dependencies—run
dip yarnafter any changes to
dip.ymlfor other common shortcuts.
Alternatively, you can launch
dip rails s,
dip sidekiq, and
dip webpackerin respective tabs. This will allow for easier debugging with
byebug(no need to attach to running Docker processes).
make upgrade-devfrom project repo to deploy the release into the cluster.
:warning: You don't have to use Quay as Docker image backend, in that case you can alter
Makefilepush commands to your own image hosting provider.
:pray: Suggestions and PRs are welcome!