App stuck in loop

Hey hey, the file you sent was the bash script that’s being run by the Dockerfile;
Could you send us the Dockerfile so we can have a look at that?

I sent both via PM to @izavits

Will send over to you in a moment :slight_smile:

Thanks! We’ll have a look

1 Like

Hello @prash! It appears that your script file is exhibiting expected behaviour. When the command specified in the Dockerfile exits, the docker daemon automatically shuts down the container. Your application script must not exit if you want the application to continue running. You could accomplish this by running your application directly, rather than starting it through the init system. Alternatively, you could add a sleep loop to the end of your script like so:

while true; do sleep infinity; done;

It’s strange that this issue is happening all of a sudden when up until now it’s been fine.

You could accomplish this by running your application directly, rather than starting it through the init system.

Could you expand on this please?

Do you mean just doing RUN deploy.sh instead of CMD?

Thanks

I’m not sure why your application didn’t restart in previous situations. The behaviour you see now is correct.

Based on what I see in your startup script, it appears you are starting up several processes running under the init system. For example, the command supervisorctl restart lumen-worker:*, appears to start some kind of service in the background. If you could change the script to run that process in the foreground, your startup script would run as long as the process does, preventing the startup loop.

Thank you for the additional information. I’ll spend some more time playing around with it.

Just following up, thank you guys for your help! I understand now why the looping was happening and why it is the expected behaviour. I really struggled with this because it was working fine in the past! I wonder what made it change all of a sudden.