# Rocketchat failed to run via docker-compose

**URL:** <https://forums.rocket.chat/t/rocketchat-failed-to-run-via-docker-compose/10320>\
**Category:** Community Support\
**Created:** [February 10, 2021, 5:57pm UTC](https://forums.rocket.chat/t/rocketchat-failed-to-run-via-docker-compose/10320 "2021-02-10T17:57:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![omid](https://avatars.discourse-cdn.com/v4/letter/o/2bfe46/32.png) [@omid](https://forums.rocket.chat/u/omid)\
**Post date:** [February 10, 2021, 5:57pm UTC](https://forums.rocket.chat/t/rocketchat-failed-to-run-via-docker-compose/10320/1 "2021-02-10T17:57:51Z")

</div>

### Description

Using rocket.chat image here’s the docker-compose.yml

```auto
        rocketchat:
                image: rocket.chat
                command: >
                        bash -c
                                "for i in `seq 1 30`; do
                                        node main.js &&
                                        s=$$? && break || s=$$?;
                                        echo \"Tried $$i times. Waiting 5 secs...\";
                                        sleep 5;
                        done; (exit $$s)"
                restart: unless-stopped
                volumes:
                        - ./uploads:/app/uploads
                environment:
                        - PORT=7000
                        - ROOT_URL=http://mywebsite.com:8065
                        - MONGO_URL=mongodb://mongo:27017/rocketchat
                        - MONGO_OPLOG_URL=mongodb://mongo:27017/local
                        - MAIL_URL=smtp://smtp.email
                depends_on:
                        - mongo
                ports:
                        - 7000:7000
                labels:
                        - "traefik.backend=rocketchat"
                        - "traefik.frontend.rule=Host: your.domain.tld"
        mongo:
                image: mongo:4.0
                restart: unless-stopped
                volumes:
                        - ./data/db:/data/db
                command: mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1
                labels:
                        - "traefik.enable=false"
        mongo-init-replica:
                image: mongo:4.0
                command: >
                        bash -c
                                "for i in `seq 1 30`; do
                                        mongo mongo/rocketchat --eval \"
                                                rs.initiate({
                                                _id: 'rs0',
                                members: [{ _id: 0, host: 'localhost:27017' }]})\" &&
                                s=$$? && break || s=$$?;
                                echo \"Tried $$i times. Waiting 5 secs...\";
                                sleep 5;
                        done; (exit $$s)"
                depends_on:
                        - mongo

```

Docker logs for rocketchat container:

```auto
MongoError: not master and slaveOk=false
    at Connection.<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/pool.js:451:61)
    at Connection.emit (events.js:315:20)
    at processMessage (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connection.js:452:10)
    at Socket.<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connection.js:621:15)
    at Socket.emit (events.js:315:20)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:271:9)
    at Socket.Readable.push (_stream_readable.js:212:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:186:23) {
  operationTime: Timestamp { _bsontype: 'Timestamp', low_: 0, high_: 0 },
  ok: 0,
  code: 13435,
  codeName: 'NotMasterNoSlaveOk',
  '$clusterTime': {
    clusterTime: Timestamp { _bsontype: 'Timestamp', low_: 0, high_: 0 },
    signature: {
      hash: Binary {
        _bsontype: 'Binary',
        sub_type: 0,
        position: 20,
        buffer: Buffer(20) [Uint8Array] [
          0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0
        ]
      },
      keyId: 0
    }
  }
}
Tried 4 times. Waiting 5 secs...

```

---

<div class="post-metadata">

**Author:** ![deepjyoti.deka](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@deepjyoti.deka](https://forums.rocket.chat/u/deepjyoti.deka)\
**Post date:** [July 9, 2021, 2:16pm UTC](https://forums.rocket.chat/t/rocketchat-failed-to-run-via-docker-compose/10320/2 "2021-07-09T14:16:41Z")

</div>

yes ! I am facing the same issue. Did you solve it?

---

<div class="post-metadata">

**Author:** ![john.crisp](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/john.crisp/32/2711_2.png) [@john.crisp](https://forums.rocket.chat/u/john.crisp)\
**Post date:** [July 12, 2021, 8:21am UTC](https://forums.rocket.chat/t/rocketchat-failed-to-run-via-docker-compose/10320/3 "2021-07-12T08:21:17Z")

</div>

Hard to tell if you have the same issue as you haven’t posted any logs or config.

On this particular issue the ports and URLs are all wrong hence the error.
