This is an example of a workflow we've developed to develop Ruby on Rails applications in Docker containers, to assure the local development occurs in the same environment as the production workload. It also has the side benefit of making local development easier: every project can be built with whatever dependencies or libraries are desired, without having to try to install them on the developers' local machines. In addition, local tools and direct code manipulation are still possible, making development feel entirely native to the local machine.
This general workflow works for other languages just as easily. See the "What about other languages?" section, below.
Assumptions:
- You have a database container that will initialize itself on startup, setup DB & user/password