Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,11 @@ services:
stdin_open: true
tty: true
command: ["/bin/bash"]


#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
Comment on lines +44 to +51
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