Is there a way to setup a rails server so that you can connect with a remote byebug server and debug easily? I've done this in the past by setting up byebug and then enabling a rails bind on 0.0.0.0 and setting a VIRTUAL_PORT=3000 but I was wondering if there were other easier ways to debug an already running container. I looked into https://docs.docker.com/engine/reference/commandline/attach/ but wasn't able to get it setup properly.
There are three ways to deploy it on the remote host: 1 Manual deployment by copying project files, install docker-compose and running it#N#A common usage of Compose is to... 2 Using DOCKER_HOST environment variable to set up the target engine#N#Throughout this exercise we use the DOCKER_HOST... 3 Using docker contexts More ...
With docker remote access, whenever you run a docker command on your local host, the effects take place on the remote server. Let me explain that in detail. What is Docker remote access? Before you dive into the setup, let me recall how docker works. Docker works in something called a client-server architecture.
We will use a Docker Compose file specific to the application to debug that application in standalone mode. Later, we will combine the Docker Compose files to execute the applications in integrated mode. Since a VS Code instance can attach to a single container, we must use a new VS Code instance to debug the Pong application.
1. Manual deployment by copying project files, install docker-compose and running it A common usage of Compose is to copy the project source with the docker-compose.yml, install docker-compose on the target machine where we want to deploy the compose app and finally run it.
See this previous answer. Do note that running your services in detached
mode isn't necessary. Also when attaching to the rails container, it'll appear as if nothing happened in your terminal until you make a request to the rails application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With