-
Notifications
You must be signed in to change notification settings - Fork 146
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
base: ensf400_w24
Are you sure you want to change the base?
Group 1 PR #152
Conversation
very nice description |
There was a problem hiding this 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?
|
||
#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 |
There was a problem hiding this comment.
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
#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 |
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 .