Skip to content

Instantly share code, notes, and snippets.

@RyanPaulMcKenna
Created August 10, 2021 00:18
Show Gist options
  • Save RyanPaulMcKenna/32bdedb6784787f7fa9c157c83b73937 to your computer and use it in GitHub Desktop.
Save RyanPaulMcKenna/32bdedb6784787f7fa9c157c83b73937 to your computer and use it in GitHub Desktop.
Bash code to be used in dockfile or docker-compose.yml to tell one container to wait for database connection on port

bash -c 'while !</dev/tcp/db/5432; do sleep 1; done; python manage.py run -h 0.0.0.0'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment