98 lines
2.2 KiB
YAML
98 lines
2.2 KiB
YAML
version: "3"
|
|
|
|
services:
|
|
mybunker:
|
|
image: bunkerity/bunkerweb:1.5.3
|
|
ports:
|
|
- 80:8080
|
|
- 443:8443
|
|
environment:
|
|
- MULTISITE=yes
|
|
- SERVER_NAME=app1.example.com app2.example.com # replace with your domains
|
|
- API_WHITELIST_IP=127.0.0.0/8 10.20.30.0/24
|
|
- SERVE_FILES=no
|
|
- DISABLE_DEFAULT_SERVER=yes
|
|
- AUTO_LETS_ENCRYPT=yes
|
|
- USE_CLIENT_CACHE=yes
|
|
- USE_GZIP=yes
|
|
- USE_REVERSE_PROXY=yes
|
|
- app1.example.com_REVERSE_PROXY_URL=/
|
|
- app1.example.com_REVERSE_PROXY_HOST=http://myapp1
|
|
- app2.example.com_REVERSE_PROXY_URL=/
|
|
- app2.example.com_REVERSE_PROXY_HOST=http://myapp2
|
|
# global config applied at server context
|
|
- |
|
|
CUSTOM_CONF_SERVER_HTTP_hello-world=
|
|
location /hello {
|
|
default_type 'text/plain';
|
|
content_by_lua_block {
|
|
ngx.say('world')
|
|
}
|
|
}
|
|
# site configs applied at server context
|
|
- |
|
|
app1.example.com_CUSTOM_CONF_SERVER_HTTP_dummy=
|
|
location = /app1 {
|
|
default_type 'text/plain';
|
|
content_by_lua_block {
|
|
ngx.say('hello app1')
|
|
}
|
|
}
|
|
- |
|
|
app2.example.com_CUSTOM_CONF_SERVER_HTTP_dummy=
|
|
location = /app2 {
|
|
default_type 'text/plain';
|
|
content_by_lua_block {
|
|
ngx.say('hello app2')
|
|
}
|
|
}
|
|
labels:
|
|
- "bunkerweb.INSTANCE"
|
|
networks:
|
|
- bw-universe
|
|
- bw-services
|
|
|
|
bw-scheduler:
|
|
image: bunkerity/bunkerweb-scheduler:1.5.3
|
|
depends_on:
|
|
- mybunker
|
|
environment:
|
|
- DOCKER_HOST=tcp://bw-docker-proxy:2375
|
|
volumes:
|
|
- bw-data:/data
|
|
networks:
|
|
- bw-universe
|
|
- bw-docker
|
|
|
|
bw-docker-proxy:
|
|
image: tecnativa/docker-socket-proxy:nightly
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
environment:
|
|
- CONTAINERS=1
|
|
- LOG_LEVEL=warning
|
|
networks:
|
|
- bw-docker
|
|
|
|
myapp1:
|
|
image: tutum/hello-world
|
|
networks:
|
|
- bw-services
|
|
|
|
myapp2:
|
|
image: tutum/hello-world
|
|
networks:
|
|
- bw-services
|
|
|
|
volumes:
|
|
bw-data:
|
|
|
|
networks:
|
|
bw-universe:
|
|
ipam:
|
|
driver: default
|
|
config:
|
|
- subnet: 10.20.30.0/24
|
|
bw-services:
|
|
bw-docker:
|