Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using remote byebug instance with docker-compose

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.

like image 217
Ben Nelson Avatar asked May 06 '17 23:05

Ben Nelson


People also ask

How to deploy Docker-Compose on a remote host?

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 ...

What is Docker remote access and how it works?

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.

How to debug a docker Pong application in VS Code?

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.

How do I deploy a docker compose project?

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.


1 Answers

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.

like image 82
Abraham Sangha Avatar answered Nov 07 '22 04:11

Abraham Sangha