Originally posted on Hint's blog.
As a software consultancy, we switch between many projects throughout the year. A critical factor in delivering ...
For further actions, you may consider blocking this person and/or reporting abuse
If you're a fan of TL;DR's, as Nate linked to, check out Railsdock.
Nate and I have been hard at work demystifying all things Docker so feel free to post comments/questions/PR's and we'll do what we can to shed light on the subject.
hintmedia / railsdock
A tool for generating Ruby on Rails development environment Docker configuration
A command line tool for Dockerizing your Rails development environment.
Prerequisite
The configuration generated by this gem depends on Docker Desktop. Make sure it is installed before continuing.
Installation
Install the gem:
Or add it to your Gemfile:
Then run:
Usage
Navigate to your project directory:
Then run:
The gem will then walk you through configuring Docker by asking questions about your environment.
Development
After checking out the repo, run
bin/setup
to install dependencies. Then, runrake spec
to run the tests. You can also runbin/console
for an interactive prompt that will allow you to experiment.To install this gem onto your local machine, run
bundle exec rake install
. To release a new version, update the version number inversion.rb
, and then runbundle
…Thanks for the post. It is surprisingly hard to find real good posts on setting up Rails with Docker and this is a great post on the topic. Going to add couple of these little gems to my current Docker setup for my Docker setup.
Do you use the same Dockerfile for production?
We build a base image that we build dev and production from. I plan to do follow up posts. I’ll keep in mind doing one about production as well.
This is great! I've been tinkering with a docker setup for development for a while now. Even have a few that I have implemented. None of them are elegant as this. In particular, I've been struggling with some of the issues you tackled in your entrypoint.sh. This is a keeper.
Two notes:
1) the location of the three files (Dockerfile, docker-compose.yml, and entrypoint.sh) are inconsistent as specified in the blog post and referenced in the docker-compose.yml file.
2) a reference to the completed files (Dockerfile, docker-compose.yml, and entrypoint.sh) would be helpful so I'm including a gist to that effect: gist.github.com/joshillian/d601a2e...
Thanks, Josh!
I had those notes while on vacation and haven’t fixed the post. Thanks for the reminder. 😁