diff --git a/docker-compose-logging.yml b/docker-compose-logging.yml new file mode 100644 index 0000000..171575e --- /dev/null +++ b/docker-compose-logging.yml @@ -0,0 +1,11 @@ +version: '3.7' + +services: + + dozzle: + container_name: dozzle + image: amir20/dozzle:latest + volumes: + - /var/run/docker.sock:/var/run/docker.sock + ports: + - 9999:8080 diff --git a/start.sh b/start.sh index cf989d2..e294f28 100755 --- a/start.sh +++ b/start.sh @@ -1,18 +1,20 @@ #!/bin/bash -usage() { echo "Usage: $0 [-c] [-o] [-n openfire-tag] [-h] +usage() { echo "Usage: $0 [-c] [-o] [-l] [-n openfire-tag] [-h] -c Launches a Cluster instead of a FMUC stack -o Launches another separate domain alongside the cluster + -l Launches a Dozzle container to collect logs -n openfire-tag Launches all Openfire instances with the specified tag. This overrides the value in .env -h Show this helpful information "; exit 0; } CLUSTER_MODE=false OTHER_DOMAIN=false +DOZZLE=false COMPOSE_FILE_COMMAND=("docker-compose") -while getopts con:h o; do +while getopts coln:h o; do case "$o" in c) CLUSTER_MODE=true @@ -20,6 +22,9 @@ while getopts con:h o; do o) OTHER_DOMAIN=true ;; + l) + DOZZLE=true + ;; n) if [[ $OPTARG =~ " " ]]; then echo "Docker tags cannot contain spaces" @@ -53,6 +58,10 @@ case $CLUSTER_MODE in COMPOSE_FILE_COMMAND+=("-f" "docker-compose-federated.yml");; esac +if [ $DOZZLE == "true" ]; then + COMPOSE_FILE_COMMAND+=("-f" "docker-compose-logging.yml") +fi + "${COMPOSE_FILE_COMMAND[@]}" down "${COMPOSE_FILE_COMMAND[@]}" pull @@ -64,4 +73,4 @@ cp -r plugins_for_clustered _data/ cp -r plugins_for_federated _data/ cp -r plugins_for_other _data/ -"${COMPOSE_FILE_COMMAND[@]}" up +"${COMPOSE_FILE_COMMAND[@]}" up -d \ No newline at end of file diff --git a/stop.sh b/stop.sh new file mode 100755 index 0000000..0921bd8 --- /dev/null +++ b/stop.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# A list of all possible docker compose files that might've been used to start the stack + +docker-compose \ + -f docker-compose-clustered.yml \ + -f docker-compose-federated.yml \ + -f docker-compose-otherdomain.yml \ + -f docker-compose-logging.yml \ +down \ No newline at end of file