Cross dependency issue

Hi,
I’m using compose to publish a web app, with containers for Django(gunicorn served), redis, nginx and postgres. Everything works well until I add huey into the mix. The nginx container has a depends on clause for the Django container, to establish the reverse proxy. However, if huey is started before the nginx container is up(such as in an entrypoint) it throws connection errors and the site comes down. I can manually exec the container and run huey after everything is up, and it works great. This obviously won’t work with restart policies though.

How might I tackle this chicken and the egg issue?
For reference, I followed this guide for setup https://testdriven.io/blog/dockerizing-django-with-postgres-gunicorn-and-nginx/

Thanks for any help you might offer!

You could create an entrypoint script for huey that waits until nginx is available.

Huey is just a django manage.py run though. ie. python manage.py run_huey

It’s part of the web docker and reaches out to the redis server to enqueue the tasks

Resolved the issue. The huey process was apparently taking over the single container process(gunicorn), as per the design idiom. I had to throw a & disown into the entrypoint and am using supervisord to monitor huey. Hopefully this is helpful to someone else :slight_smile: