cookiecutter-django icon indicating copy to clipboard operation
cookiecutter-django copied to clipboard

Why prefer python than bash for wait the service start

Open AdrianPardo99 opened this issue 2 years ago • 2 comments

Description

In this file

https://github.com/cookiecutter/cookiecutter-django/blob/master/%7B%7Bcookiecutter.project_slug%7D%7D/compose/production/django/entrypoint

Why don't use some tcp listener for docker like wait-for or wait-for-it.sh

Rationale

I think executing the python live code its a perfect idea but if we can implement a native script (bash) for implement another services that need to start first in the app maybe can replicate in other projects or services, maybe its only fork the script or the bash function.

Or maybe its only wait for the start of the service in a single file for wait until the database service is already started and exit.

AdrianPardo99 avatar Aug 24 '23 23:08 AdrianPardo99

I honestly don't know why it's been done like this, maybe the original pull request has some details. Have you tried to search in the git history?

I personally don't really have an issue with the current solution, but simplifications are always welcome. I'd be happy to replace it with an off the shelves solution.

browniebroke avatar Aug 31 '23 18:08 browniebroke

Adding wait-for to the project also comes in handy as HEALTHCHECK as discussed in https://github.com/cookiecutter/cookiecutter-django/issues/4428

foarsitter avatar Oct 25 '23 07:10 foarsitter