A
A
Anton Ivanov2019-06-25 09:22:43
Ruby on Rails
Anton Ivanov, 2019-06-25 09:22:43

How to properly develop Rails Engine with Docker?

Hello.
Started a project that uses a gem (your own) to store common entities.
Since the project is "for myself" and is not running out of time, I decided to deal with the docker normally.
Configured docker-compose to communicate with postgresql, aliases for source directories so as not to restart containers every time, and so on..
There are several questions.
1. For example, you need to run the migration in the gem (models are mainly stored in it). Since the postgres host is registered in database.yml (by the name of the container), then when we try to run the migration on the host, we will inevitably get an error. Since the container with the gem is not constantly running (unlike the container with the application where the server is running), it turns out that you need to do docker-compose run ... every time, which creates a new container, which then has to be deleted. Is it correct? And if not, how is it right?
2. Since the development is carried out locally, the path to the gem is written through bundle config local.gem_name .... Do I understand correctly that for development you need to forward both the application source directory and the gem source directory to the container with the application. And run bundle config local.gem_name already directly in the container?
Thanks

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question