https://codepany.com/blog/rails-5-and-docker-puma-nginx/
Per far funzionare byebug:
https://stackoverflow.com/questions/31669226/rails-byebug-did-not-stop-application/32690885#32690885
Add this to docker-compose.yml
web:
...<br>
stdin_open: true<br>
tty: true
Then run docker-compose in deamonized mode and attach to the web container with docker:
docker attach myappname_web_1
Note that it's not necessary to run your services in detached mode. Also when you attach to the container, it'll appear as if it's hanging, but as soon as that container's app receives a request, you'll see logger output.
Do not use docker attach myappname_web_1. Instead, run "docker container ls" to get the containers running, and then find the id of the one you are working on. Then, just run: "docker attach container_id"
docker exec -it <containerIdOrName> bash
Basically if the docker container was started using /bin/bash command you can access it using attach, if not then you need to execute the command to create a bash instance inside the container using exec
Also to exit bash without leaving bash running in a rogue process
exit
Nella cartella dell’applicazione (dove c’è il file docker-compose.yml):
$ docker-compose build
Run container(s)
$ docker-compose up
Con detach:
$ docker-compose up –d
‘Attaccarsi’ ad un container:
$ docker attach process_id
Esempio:
$ docker attach 9f4a2089327a
process_id: lo vedi con $ docker ps
Stop container(s)
$ docker-compose stop
Eseguire un comando nel container:
$ docker exec –it container_name c