DEV Community

Discussion on: Dockerize a Rails 5, Postgres, Redis, Sidekiq and Action Cable Application with Docker Compose

Collapse
 
abhinavmsra profile image
Abhinav Mishra

All my projects are docker based. As much as I love using it, i hate the extra commands you need to run for trivial stuffs like starting a rails server, console or migrations.

I usually keep those scripts in bin/ folder and simply execute the file. This way its much more straightforward and can be documented in README file for new devs.

How do you feel about this approach?

Collapse
 
biske profile image
Иван Бишевац

I agree with you.
Aliases are ok but I would prefer something that doesn't leak outside of the project.
So bin/ folder is better option IMHO.

Collapse
 
nickjj profile image
Nick Janetakis

Hi,

In that case I would ditch the scripts and just set up a few aliases at the Bash level. This way you can shorten up the command to almost what it would be without Docker, and you don't need to lug around scripts to each project.

I have some made to where I just type dew rails c and it opens a console by running docker-compose exec web rails c under the hood.

Collapse
 
abhinavmsra profile image
Abhinav Mishra

I agree but that still does not help much when you have some inexperienced developers in team.

Thread Thread
 
nickjj profile image
Nick Janetakis

Then make them experienced. :D