examples - polishing before next release

This commit is contained in:
bunkerity
2021-08-12 10:19:43 +02:00
parent 0ad5159a33
commit 83e7ce9cde
23 changed files with 228 additions and 255 deletions

View File

@@ -1,6 +1,6 @@
# Swarm wit hredis
# Swarm with redis
Basic examples on how to deploy and use bunkerized-nginx within a Docker Swarm cluster and use redis to distribute the blacklists. See the [Docker Swarm](#TODO) section of the documentation for more information.
Basic examples on how to deploy and use bunkerized-nginx within a Docker Swarm cluster and use redis to distribute the blacklists. See the [Docker Swarm integration section of the documentation](https://bunkerized-nginx.readthedocs.io/en/latest/integrations.html#docker-swarm) for more information.
## Architecture
@@ -11,8 +11,8 @@ Basic examples on how to deploy and use bunkerized-nginx within a Docker Swarm c
This example uses two overlay networks needed by the services :
```shell
$ docker network create -d overlay --attachable net_config
$ docker network create -d overlay --attachable net_services
$ docker network create -d overlay --attachable config-net
$ docker network create -d overlay --attachable services-net
```
First you need to create the redis service : see [redis.yml](https://github.com/bunkerity/bunkerized-nginx/blob/master/examples/swarm-redis/redis.yml).

View File

@@ -18,7 +18,7 @@ services:
- SWARM_MODE=yes
- API_URI=/ChangeMeToSomethingHardToGuess # must match API_URI from nginx
networks:
- net_config
- config-net
deploy:
replicas: 1
placement:
@@ -59,8 +59,8 @@ services:
- DISABLE_DEFAULT_SERVER=yes
- USE_CLIENT_CACHE=yes
networks:
- net_config
- net_services
- config-net
- services-net
deploy:
mode: global
placement:
@@ -70,7 +70,9 @@ services:
- "bunkerized-nginx.AUTOCONF"
networks:
net_config:
external: true
net_services:
external: true
config-net:
external:
name: config-net
services-net:
external:
name: services-net

View File

@@ -5,7 +5,7 @@ services:
redis:
image: redis:alpine
networks:
- net_config
- config-net
deploy:
replicas: 1
placement:
@@ -13,5 +13,6 @@ services:
- "node.role==worker"
networks:
net_config:
external: true
config-net:
external:
name: config-net

View File

@@ -7,7 +7,7 @@ services:
volumes:
- /shared/www/app1.example.com:/www
networks:
- net_services
- services-net
deploy:
replicas: 1
placement:
@@ -24,7 +24,7 @@ services:
- PMA_ARBITRARY=1
- PMA_ABSOLUTE_URI=https://app2.example.com
networks:
- net_services
- services-net
deploy:
replicas: 1
placement:
@@ -38,5 +38,6 @@ services:
- "bunkerized-nginx.REVERSE_PROXY_HOST=http://app2"
networks:
net_services:
external: true
services-net:
external:
name: services-net