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

Include Healthcheck #61

Open
mgansler opened this issue Sep 7, 2017 · 3 comments
Open

Include Healthcheck #61

mgansler opened this issue Sep 7, 2017 · 3 comments

Comments

@mgansler
Copy link

mgansler commented Sep 7, 2017

It would be nice for the container to have a health status.
Here is what I have come up with in compose, but maybe there is a better way and I think it would be great to have the healthcheck included in the image itself.

services:
  database:
    image: sath89/oracle-12c:r1
    healthcheck:
      test: ["CMD-SHELL", "if [ \"`echo \\\"SELECT ACCOUNT_STATUS FROM DBA_USERS WHERE USERNAME = 'ANONYMOUS' AND ACCOUNT_STATUS = 'EXPIRED';\\\"|/u01/app/oracle/product/12.1.0/xe/bin/sqlplus -S sys/oracle as sysdba|grep ACCOUNT_STATUS`\" = \"ACCOUNT_STATUS\" ];then true;else false;fi"]
      timeout: 3s
      interval: 30s
      # start_period: 900s
      retries: 30

"start_period" is commented out because docker/cli#475 has been merged but not released yet so compose doesn't support it (yet). "interval" and "retries" can be modified.

@0xERR0R
Copy link

0xERR0R commented Oct 31, 2017

This variant seems to work too:

      test: echo "select * from v\$database;" | sqlplus -S sys/oracle as sysdba || exit 1
      timeout: 3s
      interval: 30s
      retries: 30

@kakawait
Copy link

@MaksymBilenko regarding existing comment what do you except with help wanted flag?
I think we could use one of them test and include inside Dockerfile

@tjheslin1
Copy link

tjheslin1 commented Oct 27, 2018

I have written an application to monitor oracle databases, serving this very purpose. If you need help configuring it please feel free to raise an issue:

https://github.com/tjheslin1/Patterdale

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

No branches or pull requests

5 participants