Yohan
Yohan

Reputation: 409

Setting URL of ECS container health check

I have a docker image I want to run on AWS ECS. This is a API I want to use from other applications. I have set up the task definition, however it runs for a few minutes and then shuts down due to unhealthy status checks.

My API has an endpoint /healthy which I am using for health checks. On the page where I create a task definition I have entered the details as follows:

enter image description here

However, this is running into issues every few minutes as the health check will return unhealthy status and the container will fail. This affects my other applications as they depend on the container to provide services. This is weird to me as when I take the public IP of the task and go to that url/health it returns a healthy status.

Can anyone help me with setting the correct command for this?

Upvotes: 2

Views: 4833

Answers (1)

Marcin
Marcin

Reputation: 238309

These are Docker level checks, not your load balancer checks. For container level checks, you should provide full command used for this check, e.g.:

curl -sS http://127.0.0.1/health || exit 1

Upvotes: 7

Related Questions