Update README to support swarm
This commit is contained in:
parent
7e2b6f0f01
commit
8d7723e415
3 changed files with 13 additions and 29 deletions
13
README.md
13
README.md
|
|
@ -83,7 +83,18 @@ Important: easyhaproxy needs to be in the same network of the containers or othe
|
|||
| com.byjg.easyhaproxy.redirect.<definition> | Host redirects from connections in the port defined above. |
|
||||
| com.byjg.easyhaproxy.sslcert.<definition> | 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:
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
28
swarm.sh
28
swarm.sh
|
|
@ -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"}
|
||||
Loading…
Add table
Add a link
Reference in a new issue