diff --git a/templates/compose.yaml b/templates/compose.yaml index ca16739..33fc811 100644 --- a/templates/compose.yaml +++ b/templates/compose.yaml @@ -53,7 +53,12 @@ services: sleep 3 && bin/console cache:clear && while ! [ -f /tmp/kill_me ]; do - php -d memory_limit=2G bin/console messenger:consume priority async --limit=20 --time-limit=600 -v; + su -s /bin/bash -c 'php -d memory_limit=2G bin/console messenger:consume priority async --limit=20 --time-limit=600 -v' "$PHP_FPM_USER"; + rc=$?; + if [ $rc -ne 0 ]; then + echo "Consumer exited with status $rc. Stopping container."; + exit $rc; + fi done; pre_stop: - command: