Healthcheck should be declared in Dockerfile #1790
Replies: 3 comments
-
It was initially in the Dockerfile and I moved it to the docker-compose here: 20ec435 The main reason is you could use the same Docker image without the web server enabled. It's an optional feature. In Kubernetes, the |
Beta Was this translation helpful? Give feedback.
-
Yes, I saw this commit, it’s the reason behind this discussion 😊
I feel like it’s easier to disable an undesired healthcheck especially if you run the image with a non-default command than to find the good one to setup. |
Beta Was this translation helpful? Give feedback.
-
BTW, the start_period in the health check is only supported in compose version 3.4, while the current version is 3.3. |
Beta Was this translation helpful? Give feedback.
-
In my opinion, the healthcheck should be declared in the Dockerfile so that it benefits by default.
Users can disable it anyway if they want, see: https://docs.docker.com/compose/compose-file/compose-file-v2/#healthcheck
Beta Was this translation helpful? Give feedback.
All reactions