###
# Docker and Docker compose needs to be installed
###
if [ -x "$(command -v docker)" ]; then
if [ -x "$(command -v docker-compose)" ]; then
:
else
echo "Installing docker-compose, please wait..." && sleep 1
sudo curl -L https://github.com/docker/compose/releases/download/"${DOCKER_COMPOSE_VERSION}"/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
fi
else
echo "Installing docker, please wait..." && sleep 1
curl -fsSL get.docker.com | sh
fi
Here the check of docker-compose will be skipped if docker is not installed. so need to check one after another. means first check will be docker and second will be for docker-compose but must have docker installed.
https://github.com/EasyEngine/docker-compose-wordpress/blob/de375f8dcd152795b19565297b8872a76cd27901/multiple-sites/setup.sh#L9
Here the check of docker-compose will be skipped if docker is not installed. so need to check one after another. means first check will be docker and second will be for docker-compose but must have docker installed.