Aws Fargate Healthcheck checking response

15 Views Asked by At

I'm trying to write a heathcheck for a Aws fargate contianer...

This works up to a point

"healthCheck": {
                "command": [
                    "CMD-SHELL",
                    "wget -qO- /dev/null http://127.0.0.1:9000/api/system/status || exit 1"
                ],
                "interval": 300,
                "timeout": 5,
                "retries": 3
            },

What i want to do it to change this so that if the response has particular words in it then passes otherwise the container isnt ready..

"healthCheck": {
                "command": [
                    "CMD-SHELL",
                    "wget -qO- http://127.0.0.1:9000/api/system/status | grep -q -e '"status":"UP"' -e '"status":"DB_MIGRATION_NEEDED"' -e '"status":"DB_MIGRATION_RUNNING"' || exit 1 "
                ],
                "interval": 300,
                "timeout": 5,
                "retries": 3
            },

0

There are 0 best solutions below