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

Nginx container sometimes errors on load #87

Open
Buuntu opened this issue Jul 15, 2020 · 2 comments
Open

Nginx container sometimes errors on load #87

Buuntu opened this issue Jul 15, 2020 · 2 comments

Comments

@Buuntu
Copy link
Owner

Buuntu commented Jul 15, 2020

This has to do with not waiting for frontend and backend containers to be started before the Nginx container loads. Using something like depends_on in Docker won't work because the frontend container has technically started even before Webpack is built. Backend can be an issue too but Webpack is the one that takes a significant amount of time in my experience.

Example error:

nginx_1     | 2020/07/08 06:13:44 [emerg] 1#1: host not found in upstream "backend" in /etc/nginx/conf.d/default.conf:24
nginx_1     | nginx: [emerg] host not found in upstream "backend" in /etc/nginx/conf.d/default.conf:24

What we need is something like Docker's healthcheck or the wait-for-it script to check that these containers are responding to requests. It would also be good if Nginx can report an error message that makes sense (like that it's starting up) during this time, to avoid confusion.

@inactivist
Copy link

Do you prefer embedding a copy of wait-for-it.sh in this project repo? Otherwise we'll need to download latest version during build.

@Buuntu
Copy link
Owner Author

Buuntu commented Jul 16, 2020

I am fine including it but I am a bit wary of the behavior of it. I would prefer it not just show a blank page until Webpack builds as I think that's confusing. Can we have Nginx return a 502 error somehow before this? Maybe you have ideas.

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

No branches or pull requests

2 participants