From 9c2d4ae11ddbc9742579ea08f54a3a14d22d72d8 Mon Sep 17 00:00:00 2001 From: NateScarlet Date: Tue, 16 Jul 2019 02:40:02 +0800 Subject: [PATCH] Improve Docker compose readability (#14457) --- docker-compose.yml | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 7d878c66c505..45f614cb9e5c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,14 @@ version: '2' services: rocketchat: image: rocketchat/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)' + 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 @@ -37,7 +44,17 @@ services: # 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)"' + 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 @@ -66,7 +83,18 @@ services: #traefik: # image: traefik:latest # restart: unless-stopped - # command: traefik --docker --acme=true --acme.domains='your.domain.tld' --acme.email='your@email.tld' --acme.entrypoint=https --acme.storagefile=acme.json --defaultentrypoints=http --defaultentrypoints=https --entryPoints='Name:http Address::80 Redirect.EntryPoint:https' --entryPoints='Name:https Address::443 TLS.Certificates:' + # command: > + # traefik + # --docker + # --acme=true + # --acme.domains='your.domain.tld' + # --acme.email='your@email.tld' + # --acme.entrypoint=https + # --acme.storagefile=acme.json + # --defaultentrypoints=http + # --defaultentrypoints=https + # --entryPoints='Name:http Address::80 Redirect.EntryPoint:https' + # --entryPoints='Name:https Address::443 TLS.Certificates:' # ports: # - 80:80 # - 443:443