diff --git a/README.md b/README.md index b09614e..128e84e 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,18 @@ Important: easyhaproxy needs to be in the same network of the containers or othe | com.byjg.easyhaproxy.redirect. | Host redirects from connections in the port defined above. | | com.byjg.easyhaproxy.sslcert. | Cert PEM Base64 encoded. | -E.g. + +Note: if you are deploying a stack set labels at the `deploy` level: + +```yaml +services: + foo: + deploy: + labels: + com.byjg.easyhaproxy.definitions: "http,https" + ... +``` + ### Single Definition: diff --git a/assets/scripts/haproxy-reload.sh b/assets/scripts/haproxy-reload.sh index 5088b90..df9f603 100755 --- a/assets/scripts/haproxy-reload.sh +++ b/assets/scripts/haproxy-reload.sh @@ -6,6 +6,7 @@ RELOAD="true" if [[ "$DISCOVER" == "static" ]]; then CONTROL_FILE="/etc/haproxy/haproxy.cfg" + touch ${CONTROL_FILE} cp ${CONTROL_FILE} ${CONTROL_FILE}.old python3 static.py /etc/haproxy/easyconfig.yml > ${CONTROL_FILE} else diff --git a/swarm.sh b/swarm.sh deleted file mode 100644 index dc83f63..0000000 --- a/swarm.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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"}