Complete the Dockerfile line to add a health check that runs the command 'curl -f http://localhost/'
HEALTHCHECK CMD [1]The HEALTHCHECK CMD instruction runs the specified command inside the container to check its health. Using curl -f http://localhost/ checks if the web service is responding.
Complete the Docker Compose service definition to add a health check that retries every 10 seconds
healthcheck: test: [1] interval: 10s
RUN instead of CMD in the test array.In Docker Compose, the healthcheck test must be an array starting with CMD to run the command properly.
Fix the error in this Dockerfile health check line to correctly specify the command
HEALTHCHECK CMD [1]RUN in the command array.The health check command must be specified as a JSON array starting with the executable and its arguments. Using ["curl", "-f", "http://localhost/"] is correct.
Fill both blanks to create a health check in Docker Compose that retries every 5 seconds and fails after 3 retries
healthcheck: test: [1] interval: 5s retries: [2]
The test must be a command array starting with CMD. The retries option sets how many times Docker retries before marking unhealthy.
Fill all three blanks to define a Dockerfile health check with a 30-second timeout, 10-second interval, and 5 retries
HEALTHCHECK --timeout=[1] --interval=[2] --retries=[3] CMD curl -f http://localhost/
The --timeout sets how long to wait for the health check command, --interval sets how often to run it, and --retries sets how many failures before marking unhealthy.