Most containers run their main program as PID 1. Linux treats PID 1 differently from other processes, and many programs were never written for it.
PID 1 is expected to forward signals and to clean up child processes that have exited. If your app spawns children and does neither, you get zombie processes and slow, ugly shutdowns. Docker can put a tiny init program in front of yours to do that job.
docker run --init myimage
In a compose file it is one line on the service:
services:
worker:
image: myimage
init: true
The init binary is docker-init, which is based on tini, and it forwards signals and reaps the children. I would turn it on for anything that runs scripts, shells out a lot or starts browsers.
You can see the effect with docker top or ps inside the container: PID 1 is then the init, and your app is its child. It costs almost nothing, so I would not agonise over it.
The caveat: if the image already has its own init in the entrypoint, you do not need it twice. It also does not fix an app that ignores SIGTERM on its own, since it only makes sure PID 1 behaves.
Further reading: docker container run reference, Compose services reference: init, On this site: put optional services behind a Compose profile, On this site: docker compose watch syncs your code into a running container