Nginx container sometimes errors on load
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.
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.
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.