DEV Community

Discussion on: Dockerize the multi-services application for local development

Collapse
 
rommik profile image
Roman Mikhailov

Great Article! How do you debug and create code break points in the runtime. Maybe you could devote a section on this topic?

Collapse
 
alexanderrykhlitskiy profile image
Alexander Rykhlitskiy • Edited

There are two options using binding.pry:

1) Attach to running server container after hitting pry with

docker attach $(docker-compose ps | grep app_1 | awk '{print $1}')
Enter fullscreen mode Exit fullscreen mode

2) Run server with this command instead of docker-compose up

docker-compose run --service-ports app /bin/sh -c "rm -f tmp/pids/server.pid && rails s -b 0.0.0.0"
Enter fullscreen mode Exit fullscreen mode