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
docker-compose only runs first time #1373
Comments
I think it is just a sequencing issue:
Now spin up rocket.chat:
|
Can we add a timeout between getting the DB and the Rocket.Chat up, so the DB is ready for connections? |
@engelgabriel I haven't poked around in the startup script in the rocket container but you could put something like this at the start of it:
Just make sure that you have netcat installed in the rocket container's Dockerfile.... |
Thanks @timlinux !!! I don't have the tools to test it here. Can anyone try this out and submit a PR please? |
@timlinux that's a pretty nice way of handling it. Problem with this is, we can't assume that the container linked is going to be named db. They might name it anything. Also what if i'm not linking but actually using a mongo instance outside of docker? @engelgabriel seems like this should be handled in rocket.chat its self. It just attempt to connect and a retry with a backoff. |
@geekgonecrazy true but you already make the assumption here: https://github.com/RocketChat/Rocket.Chat/blob/master/Dockerfile#L24 - I guess that can be overridden with a If you can do it in rocket.chat itself so much the better... |
@timlinux right mongo_url can be overrode. Ideally in rocket.chat its self. Otherwise we're going to keep adding things to the dockerfile and make it unmanagable. |
@geekgonecrazy agreed! |
@geekgonecrazy I don't think that's an option, unless Meteor does it, as we have no control over the server connection code: https://github.com/meteor/meteor/blob/devel/packages%2Fmongo%2Fmongo_driver.js#L179 |
Do we still want to continue to support dev-ployment, might be the real question. Since we started using proper versioned binary builds, and stop running In production deployment (non-dev) scenarios using |
Hi, personally I did want to test this for production use. But (ok, maybe just me :-) ) do some tries before it is running as you want. Eg I first tried to run it without reverse proxy in front, then with one etc. I even had to restart docker on our prod server because of the fact that the mongodb container was unstop/killable. |
@Sing-Li awesome I hadn't seen this. Hopefully that is finished and lands in a build soon. As far as supporting dev version. I agree that when it comes to non-versioned deployments that's up to them. We do need to update all of our documentation to steer non-devs down that path. But in this case the image isn't a dev image its a versioned image produced from our build artifacts. I've personally never experienced this issue. I've used docker-compose on multiple occasions and the db always seems to start in time. When it comes to deploying new versions of rocket.chat I didn't have to stop anything. You can do:
And it'll automatically kill the old rocket.chat image and start with the new one. At least that has been my experience. |
Updated our documentation as per @timlinux's sequencing steps: https://github.com/RocketChat/Rocket.Chat/wiki/Deploy-with-Docker @rduivenvoorde - if you still have problems following the new instructions, please re-open this issue. |
Tried to run 'docker-compose up' and 'docker-compose up -d'.
First time all runs (except with an css exception that the page does not look right), but after stopping the container, removing and start and instance again there is an error with the database not starting.
without -d option you have the following in terminal:
If i stop it again, and run it with -d option it also fails, showing:
Running on Debian stable server behind apache reverse proxy. DNS-record made for chat.ourdomain.org so in docker-compose.yml it says:
Any help appreciated, thanks.
The text was updated successfully, but these errors were encountered: