diff --git a/rocket.chat/content.md b/rocket.chat/content.md index 7c032e754..d3b9c1e3c 100644 --- a/rocket.chat/content.md +++ b/rocket.chat/content.md @@ -8,16 +8,20 @@ It is a great solution for communities and companies wanting to privately host t # How to use this image -First, start an instance of mongo: +First, start an instance of mongo and initiate replicaSet: ```console -$ docker run --name db -d mongo:3.0 --smallfiles +$ docker run --name db -d mongo:4.0 --smallfiles --replSet rs0 --oplogSize 128 +``` + +```console +$ docker exec -ti db mongo --eval "printjson(rs.initiate())" ``` Then start Rocket.Chat linked to this mongo instance: ```console -$ docker run --name rocketchat --link db -d %%IMAGE%% +$ docker run --name rocketchat --link db --env MONGO_OPLOG_URL=mongodb://db:27017/local -d %%IMAGE%% ``` This will start a Rocket.Chat instance listening on the default Meteor port of 3000 on the container. @@ -25,7 +29,7 @@ This will start a Rocket.Chat instance listening on the default Meteor port of 3 If you'd like to be able to access the instance directly at standard port on the host machine: ```console -$ docker run --name rocketchat -p 80:3000 --env ROOT_URL=http://localhost --link db -d %%IMAGE%% +$ docker run --name rocketchat -p 80:3000 --link db --env ROOT_URL=http://localhost --env MONGO_OPLOG_URL=mongodb://db:27017/local -d %%IMAGE%% ``` Then, access it via `http://localhost` in a browser. Replace `localhost` in `ROOT_URL` with your own domain name if you are hosting at your own domain. @@ -33,5 +37,5 @@ Then, access it via `http://localhost` in a browser. Replace `localhost` in `ROO If you're using a third party Mongo provider, or working with Kubernetes, you need to override the `MONGO_URL` environment variable: ```console -$ docker run --name rocketchat -p 80:3000 --env ROOT_URL=http://localhost --env MONGO_URL=mongodb://mymongourl/mydb -d %%IMAGE%% +$ docker run --name rocketchat -p 80:3000 --env ROOT_URL=http://localhost --env MONGO_URL=mongodb://mymongourl/mydb --env MONGO_OPLOG_URL=mongodb://mymongourl:27017/local -d %%IMAGE%% ```