Long story short, I have some base images that don’t call the service its running directly in the ENTRYPOINT command.
Instead, I made custom .ps1 scripts (to execute commands that must be done at container/service runtime) before finishing with a direct call to the application. (Sometimes even a call to start a windows service and wait until it’s in a stopped status.)
Since these commands are executed in a powershell script, I am wondering how the actual applications get shutdown, when for example a service replica/container fails a healthcheck and needs to be recreated.
It is my understanding that even if I run a given process in the foreground from my powershell entrypoint, powershell will not ‘forward’ the appropriate signal to the actual process, but instead kill it forcefully. I ask because I do not want to corrupt any persistent data services may be writing to when they fail a healthcheck. The biggest one to worry about being a database service.
Am I misunderstanding the innerworkings of containers here? Do I need to handle this in my entrypoint ps1 scripts? Basically, how can I ensure my database process called from an entrypoint script gracefully shuts down when the orchestrator deems it unhealthy? Do I need to rethink my approach to entrypoint scripts? Any help is appreciated