cookiecutter / cookiecutter-django

Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly.
https://cookiecutter-django.readthedocs.io
BSD 3-Clause "New" or "Revised" License
12.04k stars 2.88k forks source link

Why prefer python than bash for wait the service start #4539

Closed AdrianPardo99 closed 2 days ago

AdrianPardo99 commented 1 year ago

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.

browniebroke commented 1 year ago

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.

foarsitter commented 11 months ago

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