From 22b02de40575f3ccb4c4a8143123d9e911c3f233 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 25 Nov 2018 12:44:49 +0100 Subject: [PATCH] Updated swoole docker image so that it retries the start command until status code is 0 --- data/infra/swoole.Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/data/infra/swoole.Dockerfile b/data/infra/swoole.Dockerfile index 77844ca7..40293eaa 100644 --- a/data/infra/swoole.Dockerfile +++ b/data/infra/swoole.Dockerfile @@ -92,4 +92,7 @@ WORKDIR /home/shlink # Expose swoole port EXPOSE 8080 -CMD /usr/local/bin/composer update && php ./vendor/bin/zend-expressive-swoole start +CMD /usr/local/bin/composer update && \ + # When restarting the container, swoole might think it is already in execution + # This forces the app to be started every second until the exit code is 0 + until php ./vendor/bin/zend-expressive-swoole start; do sleep 1 ; done