2

docker config as the site ask us to do.


 services:
   rocketchat:
     image: rocket.chat:latest
     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=3000
       - ROOT_URL=https://muradempreendimentos.com
       - MONGO_URL=mongodb://mongo:27017/rocketchat
       - MONGO_OPLOG_URL=mongodb://mongo:27017/local
     depends_on:
       - mongo
     ports:
       - 3000:3000

   mongo:
     image: mongo:4.0
     restart: unless-stopped
     command: mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1
     volumes:
       - ./data/runtime/db:/data/db
       - ./data/dump:/dump

   # this container's job is just to run the command to initialize the replica set.
   # it will run the command and remove himself (it will not stay running)
   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

output after running the command "sudo docker-compose logs -f rocketchat"

ERROR: yaml.parser.ParserError: while parsing a block mapping
  in "./docker-compose.yml", line 1, column 1
expected <block end>, but found <block mapping start>
  in "./docker-compose.yml", line 3, column 2

What can I try next to resolve this?

halfer
  • 19,824
  • 17
  • 99
  • 186

1 Answers1

0

I copied and pasted your file and attempted to setup the rocketchat. The only issue I found was the lack of version. From docs:

Compose files using the version 2 syntax must indicate the version number at the root of the document.

After adding version: '2' at the top of the file, I had no problems setting up mongo and rocketchat using your file.

Also had no issues with yaml formatting. The format of the file you have is correct yaml.

Marcin
  • 215,873
  • 14
  • 235
  • 294