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

Group 1 PR #152

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

Conversation

michaeltapang13
Copy link

Added a health check on the docker-compose.yml file. This makes sure container remains healthy by periodocally checking if makes an HTTP request to localhost. If it fails it tries 3 more times before considering container .

@CDEguia
Copy link
Collaborator

CDEguia commented Mar 14, 2024

very nice description

Copy link
Collaborator

@CDEguia CDEguia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As is, the healthcheck is not being applied to any service. Please indent the healthcheck and it parameter so it get's applied to a service.

P.S. was this tested as is?

Comment on lines +44 to +51

#This can help Docker automatically handle container failures and restart unhealthy containers.
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost/ || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentaion level is as if it is a service. To apply this heathcheck to a service it must me indented just like image or environmnet is. The suggested code change below would apply the health check to the app2 service

Suggested change
#This can help Docker automatically handle container failures and restart unhealthy containers.
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost/ || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
# This can help Docker automatically handle container failures and restart unhealthy containers.
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost/ || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s

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.

2 participants