I am trying to test if my service running in docker container well, so I want to call url 'http://localhost:3000/test' and check if it is 200. In all other cases I want to fail my bitbucket pipeline.
So at first I have tried to curl it, but I dont get any output or error.
curl -f "http://localhost:3000/test" || exit 1
But it passes it anyway, even if url is bad or container is not running at all.
Then I have tried to call wget
right in container but I doesn't succeed too.
docker exec -ti -t -i mycontainer sh -c "wget http://localhost:3000/test || exit 1" || exit 1
It fails on the input device is not a TTY
Thanks for your help.