Project

wellcar

0.0
No commit activity in last 3 years
No release in over 3 years
A command line suite to ease conventional use of a Docker-based dev env for Ruby on Rails
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
>= 0

Runtime

= 2.19.0
 Project Readme

Wellcar, to containerize Rails

A personal project and reference to both better understand how to use Docker with Rails, and to help automate the set up of a Rails application that is developed and deployed in Docker containers.

This is very much an unstable, untested project that is for my own curiosity. As such, please look around but do not expect anything to work well, if at all, on your own Rails app.

If this project is of interest, give me a shout on Twitter.

I have published the gem to Rubygems.org, purely to make sure that the name wellcar isn't taken by a different library.

Inspiration

There are better libraries around to help use Docker with Rails than the current state of wellcar. I've found them inspiring and helpful to think about what I want to achieve with Docker and Rails.

  • The DIP gem by @bidendi is an inspiration for my tinkering here. Check it out if you're serious about developing and deploying Rails apps in Docker containers!
  • Kuby is a tool that automates Docker and Kubernetes for a Rails app. I discovered this via Ruby Weekly literally as I was going through publishing wellcar.

Approach

I've taken a pragmatic, quick-and-dirty approach to building wellcar so far.

Templating files for Dockerising

Docker files generation rather crudely relies on ERB templating. There are pairs of .erb and .rb files within lib/wellcar/templates/ for each of the files that get generated by wellcar new and wellcar dock.

I would prefer to have some sort of AST for the different file types to make the system more flexible. However, I don't know enough about Docker, the files I might need to manage, or ASTs to try to tackle that right now. It would be a long-term goal to do this.

Running commands

Commands are also crudely executed with system() calls. This is a clunky approach but has helped me deep-dive into Docker and understand the command hierarchy, particularly between docker and docker-compose, and the workflow for deploying apps.

At some stage, it might be possible to interact with the Docker Daemon directly although it's debatable whether this is advantageous or not.

Installing wellcar

Honestly, for the time being it's best not to.