Closed ahmed2m closed 1 year ago
If anyone is here and wondering, it's something related to the image being a postgres container, healthcheck needs to be defined for example:
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "${POSTGRES_DB}"]
interval: 30s
timeout: 60s
retries: 5
Description
I have a docker-compose setup that include postgres database service. Apparently part of Postgres server initialisation process is stopping and restarting.
part of a normal postgres log that I saw parts of breifly in EFS log on the console before teh compose-cli deleted everything.
FROM: this SO question as I wasn't fast enough to copy from the console
Steps to reproduce the issue:
docker compose --project-name name --file file.yml up
with a docker-compose file similar to mine.Describe the results you received: After the DbService is created successfully and while three other services are being created, the health check fails for DbService and after deleting everything, the error I get is:
DbService ServiceSchedulerInitiated: Task failed ELB health checks in (target-group arn:aws:elasticloadbalancing:us-east-1:[...])
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker-compose --version
:Docker Compose version 2.12.2
Output of
docker version
:Output of
docker context show
:You can also run
docker context inspect context-name
to give us more details but don't forget to remove sensitive content.Output of
docker info
:Additional environment details (AWS ECS, Azure ACI, local, etc.): My docker-compose generates about 88 tasks and takes a while to startup some of the services.
NOTE: I tried to disable health check to make sure it would all work after successful deployment:
That generated
HealthCheck: {}
inDbTaskDefinition
but faced that error