docker icon indicating copy to clipboard operation
docker copied to clipboard

[IMP] Odoo 15.0-17.0: Add support for docker healthcheck.

Open amh-mw opened this issue 2 years ago • 5 comments

Fixes #115. Utilizes the endpoints added in https://github.com/odoo/odoo/pull/56522.

amh-mw avatar Nov 02 '22 17:11 amh-mw

Per the Dockerfile reference ^1,

--interval=DURATION (default: 30s)
--timeout=DURATION (default: 30s)
--start-period=DURATION (default: 0s)
--retries=N (default: 3)

On my local container, Odoo stands up in about eight seconds. This includes some reasonable number of modules already installed, but without --init or --upgrade. The defaults seem fine to me.

amh-mw avatar Nov 02 '22 17:11 amh-mw

This will fail if either the longpolling port or the longpolling port is changed. Also, longpolling is disabled by default so nothing will listen on 8072 and the healthcheck will fail

oskardotglobal avatar Jul 01 '23 10:07 oskardotglobal

This will fail if either the longpolling port or the longpolling port is changed.

If the user is savvy enough to change the ports, they can also change the health check.

Also, longpolling is disabled by default so nothing will listen on 8072 and the healthcheck will fail

This is a fair point. I've removed the longpolling/websocket health check.

amh-mw avatar Nov 29 '23 18:11 amh-mw

@amh-mw an idea to maybe get this added would be to add it commented-out so that people can uncomment and build with healthchecks.

I use this pattern for example which allows me to copy and paste among various HTTP based services. Feel free to borrow the idea to remove the piped exit

HEALTHCHECK CMD ["curl", "-sIf", "-o", "/dev/null", "http://localhost:8069/web/static/img/favicon.ico"]

lathama avatar Apr 02 '24 17:04 lathama

@amh-mw an idea to maybe get this added would be to add it commented-out so that people can uncomment and build with healthchecks.

The HEALTHCHECK currently hits the peer-reviewed /web/health endpoint... not really sure what could be better than that.

amh-mw avatar Apr 02 '24 18:04 amh-mw