diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index 4ecc205..9cd5ccb 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -3,14 +3,6 @@ version: '3' services: planka: image: ghcr.io/plankanban/planka:dev - command: > - bash -c - "for i in `seq 1 30`; do - ./start.sh && - s=$$? && break || s=$$?; - echo \"Tried $$i times. Waiting 5 seconds...\"; - sleep 5; - done; (exit $$s)" restart: unless-stopped volumes: - user-avatars:/app/public/user-avatars diff --git a/docker-compose.yml b/docker-compose.yml index 9d8fef1..a8f6f83 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,14 +3,6 @@ version: '3' services: planka: image: ghcr.io/plankanban/planka:latest - command: > - bash -c - "for i in `seq 1 30`; do - ./start.sh && - s=$$? && break || s=$$?; - echo \"Tried $$i times. Waiting 5 seconds...\"; - sleep 5; - done; (exit $$s)" restart: unless-stopped volumes: - user-avatars:/app/public/user-avatars diff --git a/start.sh b/start.sh index 5e10d63..d7f0087 100755 --- a/start.sh +++ b/start.sh @@ -1,4 +1,13 @@ #!/bin/bash set -e -node db/init.js -exec node app.js --prod $@ + +for i in $(seq 1 30); do + echo "Attempting to initialize the database and start the Planka (attempt $i)..." + node db/init.js && + exec node app.js --prod "$@" && + break || s=$?; + echo "Failed (attempt $i). Waiting 5 seconds before the next attempt..."; + sleep 5; +done + +exit $s