docker config 作为站点要求我们这样做。
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
运行命令“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
接下来我可以尝试解决什么?
最佳答案
我复制并粘贴您的文件,并尝试设置rocketchat
。我发现的唯一问题是缺少version
。从docs:
在文件顶部添加version: '2'
后,使用您的文件设置mongo
和rocketchat
没问题。
yaml格式也没有问题。您拥有的文件格式是正确的yaml。
关于docker - 尝试在AWS上安装RocketChat时出错,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/61968533/