-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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] Add retries to docker-compose.yml, to wait for MongoDB to be ready #13199
Conversation
I'm not sure what to do about the test errors as I didn't modify anything related to them. |
Thanks for the contribution! That's a nice 1 line check. Can you sign the CLA? |
I did sign it! With the interactive CLAassistant |
The companion docs PR is here: https://github.com/RocketChat/docs/pull/1050 |
I'm not sure about the process, I have signed the CLA about 3 times, and then the CLA Bot comments saying that I signed it. And a couple days later it edits the comment and I appear again as if I hadn't signed it. Am I doing something wrong? |
Looks like all is good from CLA standpoint. 👍 |
Cool! Thanks |
I see that the Circle CI build is always "Pending — Your job is on hold on CircleCI!", is there anything that I have to do on my side to "un-pause" it? |
@tiangolo that's expected, it's a job we added to be able to trigger the docker image build manually when we need to test the PR, you can see it's not marked as required here. |
Get it. Thanks! |
@tiangolo have you tested this with any particular version of mongo? On some mongo version, issuing the |
I'm using it on a CI/CD environment/application with |
The current
docker-compose.yml
file requires manual steps to deploy a Rocket Chat stack, it cannot be done in a single deterministic command or integration with CI systems.The current instructions require to wait for MongoDB to be ready, and then starting the
mongodb-init-replica
service manually, and then therocketchat
service manually too.That means that, if starting from scratch, with a fresh MongoDB container, at the firsts
docker-compose up -d
, those two services will fail to start and stay down.The proposed change makes those two services wait for MongoDB to be ready, by retrying 30 times, waiting 5 seconds before each retry. That way, when the service
mongo
is ready,mongo-init-replica
will run, initialize the replica set and exit normally (with exit code 0). And thenrocketchat
will be able to start with the initialized MongoDB.This would make the instructions for Docker Compose here: https://rocket.chat/docs/installation/docker-containers/docker-compose/
Be almost only
docker-compose up -d
.And after a bit, everything will be ready.
The docs PR is here: https://github.com/RocketChat/docs/pull/1050