(sudo mkdir -p "$HOME"/tmp/config && sudo cp ./src/main/resources/application.yml "$HOME"/tmp/config)||true# This also replaces an existing "application.yml".
(sudo docker compose --profile all up --build -d &&echo -e "\nThe Urls_Controller, Prometheus and Grafana docker-containers started running.\nWaiting 65 seconds before getting their status..\n")|| handle_error "Could not list docker containers!"4
else
(sudo docker compose --profile onlyController up --build -d &&echo -e "\nThe Urls_Controller docker-container started running.\nWaiting 65 seconds before getting its status..\n")|| handle_error "Could not list docker containers!"4
sudo docker ps -a || handle_error "Could not get the status of docker-containers!"5# Using -a to get the status of failed containers as well.
echo -e "\n\nGetting the logs of docker-container \"urlscontroller-urls_controller-1\":\n"
sudo docker logs "$(sudo docker ps -aqf "name=^urlscontroller-urls_controller-1$")"|| handle_error "Could not get the logs of docker-container \"urlscontroller-urls_controller-1\"!"6# Using "regex anchors" to avoid false-positives. Works even if the container is not running, thus showing the error-log.