This is Docker's COMPOSE_FILE environment variable but note, if it's not provided, Docker "Compose looks for a file named docker-compose.yml in the current directory and then each parent directory in succession until a file by that name is found." which might surprise or please if you've got multiple docker compose builds. We made this mistake on our Jenkins build pipline causing it to fail because a Git repository was wrongly presumed to require building by Docker, except it didn't, causing Docker Compose to directory traverse looking for a compose file which it never found.

The bash command called command is used to "Execute a simple command or display information about commands." (Use help command within your shell to see the options.

It checks that the docker command exists. The standard output from command is thrown away to /dev/null. The 2>&1 means temporarily sending any errors (such as docker not being found) to the shell's stdout and displaying an error message accordingly.

So command -v docker >/dev/null 2>&1 || runs command as normal, is it finds Docker then commands output is redirected to /dev/null, otherwise we have an error and a relevant error message is spat out.

The bash command command also "Can be used to invoke commands on disk when a function with the same name exists" thus avoiding some unlikely but name collision bugs producing false positives.

tput rev inverts the display colour (known as "reverse video mode") so black is displayed as white and vice-versa:

tput bold # bold makes the error message bold

tput sgr0 turns off these settings.

All the various options to tpu are known as 'capnames' (terminal capability names)