CodeForPoznan / codeforpoznan.pl_v3

Other
8 stars 45 forks source link

Container shutdown speed fix #554

Open Deelite34 opened 6 months ago

Deelite34 commented 6 months ago

Story / Bug id:

N/A

Description:

Adds minor optimization and speeds up frontend and backend applications shutdown in docker, by making them correctly receive SIGTERM signal from docker.

exec makes frontend/backend app commands executed in entrypoint scripts main processes instead subprocesses of entrypoint script in their containers, which fails to pass termination signals to them.

init: true setting in docker makes apps executed with the entrypoint script subprocesses of dummy PID: 1 init process that will pass signals correctly to the application subprocess and avoid theorical issues with making frontend/backend app main processes.

https://buddy.works/tutorials/optimizing-dockerfile-for-node-js-part-1#reducing-the-number-of-processes https://hynek.me/articles/docker-signals/#bonus-best-practice-let-someone-else-be-pid-1 https://engineeringblog.yelp.com/2016/01/dumb-init-an-init-for-docker.html

Before: obraz

After: obraz

Migrations:

N/A

New imports / dependencies:

N/A

What tests do I need to run to validate this change:

N/A