Skip to content

Development with Docker

Josh edited this page Feb 17, 2018 · 12 revisions

Debugging

Developing with Docker is just as comfortable as rbenv or rvm and the typical rails s and binding.pry or byebug workflow, and I find it more comfortable than foreman.

After getting the docker machines and services running with docker-compose up, you can attach to an individual service with:

docker attach limestone_{service}_1`

where {service} could be website. This will follow the server output and using pry or byebug will be interactive. You could also run docker attach limestone_sidekiq_1 to attach to the background processor.


Commands

To run rails/rake (same thing now) or bundler, you can use

docker-compose exec {service} rails ...`

For example, docker-compose exec website rails routes.


Stopping services

To stop services, cmd/ctrl+c from the terminal you wrote docker-compose up from will send the terminate signal to all running processes. There's a bug in Docker where sometimes it will instead output ERROR: Aborting. In this event, running docker-compose down will kill the still running processes.

To start your environment over, you can delete all volumes while shutting down with docker-compose down -v. This will delete your database and return your disk to it's original state. All uploads in the storage folder would be removed.

Clone this wiki locally