Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amh-mw
Copy link

@amh-mw amh-mw commented Nov 2, 2022

Fixes #115. Utilizes the endpoints added in odoo/odoo#56522.

@amh-mw
Copy link
Author

amh-mw commented Nov 2, 2022

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.

Footnotes

  1. https://docs.docker.com/engine/reference/builder/#healthcheck

@oskardotglobal
Copy link

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

@amh-mw amh-mw changed the title [IMP] Odoo 15.0-16.0: Add support for docker healthcheck. [IMP] Odoo 15.0-17.0: Add support for docker healthcheck. Nov 29, 2023
@amh-mw
Copy link
Author

amh-mw commented Nov 29, 2023

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.

@lathama
Copy link

lathama commented Apr 2, 2024

@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"]

@amh-mw
Copy link
Author

amh-mw commented Apr 2, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants