Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kill container on app start fail #61

Open
MiaMish opened this issue Jun 3, 2019 · 2 comments
Open

Kill container on app start fail #61

MiaMish opened this issue Jun 3, 2019 · 2 comments

Comments

@MiaMish
Copy link

@MiaMish MiaMish commented Jun 3, 2019

I read this issue: tiangolo/uwsgi-nginx-flask-docker#3
It seems that setting need-app = true is not enough to kill the container, as supervisor keeps on restarting the app.
Please consider adding autoresetart=false in supervisord.conf section for uwsgi, or to make these easily configurable in other some way.
To have supervisor actually kill the container you'd have to set up some more configuration, see:
https://serverfault.com/questions/760726/how-to-exit-all-supervisor-processes-if-one-exited-with-0-result

@desaintmartin
Copy link
Contributor

@desaintmartin desaintmartin commented Jun 3, 2019

If you are using an orchestrator like Kubernetes, you can add some liveness probe that will restart the container if either nginx or uwsgi is not working.

In any case, you can override the supervisor configuration file in your image to fit your needs!

I've been myself thinking of an even more extreme solution for some time now: have a dedicated nginx container and a dedicated uwsgi container. This way, it is atomic. But I haven't done it because... this image simply works for our use case and is easily debuggable.

@ReallyLiri
Copy link

@ReallyLiri ReallyLiri commented Jul 3, 2019

Made the simple required steps to make image crash on app fail:
https://gist.github.com/ReallyLiri/f833510d350b242ff89b9b76fdf21ea5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.