Skip to content

Instantly share code, notes, and snippets.

@sebasjimenez10
Last active September 27, 2018 17:30
Show Gist options
  • Save sebasjimenez10/c8083cfc0fc9e42d65fcf90b9eba8cd0 to your computer and use it in GitHub Desktop.
Save sebasjimenez10/c8083cfc0fc9e42d65fcf90b9eba8cd0 to your computer and use it in GitHub Desktop.
Dockerizing existing Rails App

Dockerizing an existing Rails App

I've been working on a small rails application and I've been wondering about the best way to have a development environment almost as identical as the production environment this app would run on. There are a few ways that I've seen around this, like normalizing environments by vendoring all the gems, setting ruby version files, versioning every gem you use in the Gemfile (which is a VERY recommended practice by the way). But all of this revolves around the rails project itself. We should also keep in mind all the things that affect our project, like the db version we use, if we use redis, or any other external service.

This is why I decided to give a try to docker, since in my experience I've always installed and bundled my apps directly on my machine.

Here are some of the things I learned in the process.

Installing Docker

I believe this is something that has changed so much in the last few years. And as the time goes, communities improve their way of doing this things. I had my experience with Docker for Mac and I really liked how easy it is to install it. I believe it would be the same thing as running brew cask install docker but wanted to point out that other option in case it could be useful for someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment