Haproxy "Exit Code 0" on AWS ECS Docker container


I am trying to run the haproxy container on my AWS ECS Fargate cluster. I have pulled the haproxy docker image from dockerhub with version: 2.0.21.

The container runs for 2/3 seconds and stops with the “Exit Code 0”. From my understanding, exit code 0 means there is no process to run inside the container.

The command I am using to run haproxy is:
haproxy -f /etc/haproxy/haproxy.cfg

When I checked for the logs, There are no error logs. All I am getting now in the logs is:
proxy backend_xxxxxx started
proxy backend_xxxxxx started

I am running the process on the foreground but still it stops with ‘Exit Code 0’. I have searched a lot regarding the issue but no luck.

Any help or suggestion from anyone is appreciated.