-
Notifications
You must be signed in to change notification settings - Fork 356
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
fix: Make sure the backend and front end are available before launching nginx #83
Conversation
Did you check that this actually made a difference? When I tried it it has the same net result. You still get the errors because even though the container is started, it's still building webpack. Is it actually failing or is that just an error while the frontend boots up? Did it actually not load the site? |
Yeah, I've used the Edit -- The docker-compose Control startup and shutdown order in Compose documentation recommends
|
In my experience, the $ docker-compose logs nginx
[extraneous log entries elided]
nginx_1 | 2020/07/15 12:26:37 [emerg] 1#1: host not found in upstream "backend" in /etc/nginx/conf.d/default.conf:20
$ docker-compose ps
Name Command State Ports
-------------------------------------------------------------------------------------------------------------------------
my-test-app_backend_1 python app/main.py Up
my-test-app_flower_1 flower flower --broker=red ... Up 0.0.0.0:5555->5555/tcp
my-test-app_frontend_1 /bin/bash /app/run.sh start Up 35729/tcp, 8000/tcp
my-test-app_nginx_1 nginx -g daemon off; Exit 1
my-test-app_postgres_1 docker-entrypoint.sh postgres Up 0.0.0.0:5432->5432/tcp
my-test-app_redis_1 docker-entrypoint.sh redis ... Up 0.0.0.0:6379->6379/tcp
my-test-app_worker_1 celery worker -A app.tasks ... Up |
@inactivist Do you want to take a stab at it using something like wait-for-it or Docker healthcheck? My nginx container just gives me a 502 or 504 error until Webpack boots up, which is not ideal but the alternative (no error) might be even more confusing. I created an issue for this and will close this PR as I don't think it solves the underlying problem: #87 |
I'll take a look at it soon. We'll continue this on #87 |
Upon reflection, I think this is a valid PR and needs to be merged, as the startup ordering sequence should guarantee the At a minimum, the Any Webpack compilation issues should be dealt with separately, IMO |
Currently this may in some cases cause nginx to fail at startup, with error: