Add optional logging container, run compose in background

pull/48/head
Dan Caseley 2021-12-01 10:09:13 +00:00
parent b5c5659164
commit a5d717688c
2 changed files with 23 additions and 3 deletions

View File

@ -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

View File

@ -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