Use docker for everyday development with Rails

I am a Ruby / Rails developer. To work with different projects and with different versions of Ruby, I use Docker. I execute some commands very, very often. I need to do this quickly and quickly complete the runtime. Without Docker, I like to use Spring because I save a few seconds each time (from 8 to 20 seconds in the current project). I found a way to still use it with Docker, I start a bash session using docker-compose run web bash, and I run my command inside. This works, but there are a few drawbacks. I have to constantly open the Tmux panel. It does not work with some vim plugins when I need to execute a command and get the result.

I can execute the exec command in the runner container by running docker exec -it bin / rspec. It works, but it disables Spring every time.

I can also install all my favorite tools (vim, tmux, zsh, etc.) inside my development containers, but I don't think this is good practice.

I am looking for a solution as similar as possible than executing a command inside my local machine. I think it is possible to create a shortcut, for example de my_commandfor docker exec.

Do you have a solution? Do you have the same problems? Is it good practice to use docker for everyday development?

+4
source share

Source: https://habr.com/ru/post/1616646/


All Articles