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
接下来我可以尝试解决什么?
答案 0 :(得分:0)
我复制并粘贴了您的文件,并尝试设置m
。我发现的唯一问题是缺少n
。来自docs:
使用版本2语法编写文件时,必须在文档的根部指出版本号。
在文件顶部添加df1
之后,使用您的文件设置rocketchat
和version
没问题。
yaml格式也没有问题。您拥有的文件格式是正确的Yaml。