I am running a Rails 7 app through docker-compose. When I try to use binding.break in the code, my attached terminal shows something like the following:
web | Started POST "/media_uploads" for 172.19.0.1 at 2022-07-02 20:57:26 +0000
web | Cannot render console from 172.19.0.1! Allowed networks: 127.0.0.0/127.255.255.255, ::1
web | [29, 38] in /web/config/initializers/rack_attack.rb
web | 29| end
web | 30|
web | 31| # Intended to prevent bulk upload overloading, but may have other consequences
web | 32| throttle('posts/ip', limit: 1, period: 1) do |req|
web | 33| if req.post?
web | => 34| binding.break
web | 35| req.ip
web | 36| end
web | 37| end
web | 38| ### Prevent Brute-Force Login Attacks ###
web | =>#0 block {|req=#<Rack::Attack::Request:0x00007fa9990ffc...|} in <class:Attack> at /web/config/initializers/rack_attack.rb:34
web | #1 Rack::Attack::Throttle#discriminator_for(request=#<Rack::Attack::Request:0x00007fa9990ffc...) at /usr/local/bundle/gems/rack-attack-6.6.1/lib/rack/attack/throttle.rb:53
web | # and 50 frames (use `bt' command for all frames)
but doesn't provide me with an input buffer to enter commands. I have to kill the process in order to do anything on the server. My docker-compose includes
tty: true
stdin_open: true
but it still doesn't work. Any ideas what to try?
EX: I have a docker-composer.yml
If you debug, you must access container_name of app with
docker attach container_name.EX: docker attach anywork_name. It is work for you.