1
0
Fork 0
docker-easy-haproxy/swarm.sh
2019-07-17 22:12:04 -05:00

28 lines
1.1 KiB
Bash

#!/usr/bin/env bash
#docker run \
# -l com.byjg.easyhaproxy.definitions=http \
# -l com.byjg.easyhaproxy.port.http=80 \
# -l com.byjg.easyhaproxy.port.localport=80 \
# -l com.byjg.easyhaproxy.host.http=byjg.com.br \
# -l com.byjg.easyhaproxy.redirect.http=byjg.com.br--http://www.byjg.com.br,byjg.com--http://www.byjg.com.br \
#-d byjg/php:7.3-fpm-nginx
touch /tmp/.docker_data /tmp/docker_data_old
cp ./.docker_data ./docker_data_old
CONTAINERS=$(docker node ps $(docker node ls -q) --format "{{ .Name }}" --filter desired-state=running | cut -d. -f1 | sort | uniq)
for container in $CONTAINERS; do
docker inspect --format "{{ json .Spec.Labels }}" $container | xargs -I % echo $container=% >> ./.docker_data
done
if cmp -s ./.docker_data ./.docker_data_old ; then
exit 0
fi
python3 swarm.py
# byjg_site={"com.byjg.easyhaproxy.definition":"http","com.byjg.easyhaproxy.host.http":"byjg.com.br","com.byjg.easyhaproxy.port.http":"80","com.byjg.easyhaproxy.redirect.http":"byjg.com.br%http://www.byjg.com.br,byjg.com%http://www.byjg.com.br","maintainer":"Joao Gilberto Magalhaes"}