examples improvement - traefik alternative, autoconf reverse proxy and basic website

This commit is contained in:
bunkerity
2021-08-04 12:01:07 +02:00
parent 6d73fbdedb
commit 44de2253d2
17 changed files with 170 additions and 152 deletions

View File

@@ -0,0 +1,13 @@
# Autoconf reverse proxy
Quickly deploy web app on Docker containers without restarting bunkerized-nginx.
## Architecture
<img src="https://github.com/bunkerity/bunkerized-nginx/blob/dev/examples/autoconf-reverse-proxy/architecture.png?raw=true" />
## Autoconf
First of all, you need to run bunkerized-nginx and bunkerized-nginx-autoconf : see [docker-compose-nginx.yml](https://github.com/bunkerity/bunkerized-nginx/blob/master/examples/autoconf-reverse-proxy/docker-compose-nginx.yml).
Then, you can add and remove web apps with special `bunkerized-nginx.*` labels so the configurations are automatically generated : see [docker-compose-apps.yml](https://github.com/bunkerity/bunkerized-nginx/blob/master/examples/autoconf-reverse-proxy/docker-compose-apps.yml).

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,50 @@
version: '3'
services:
myapp1:
build: js-app
restart: always
environment:
- NODE_ENV=production
labels:
- "bunkerized-nginx.SERVER_NAME=app1.example.com" # replace with your domain
- "bunkerized-nginx.REVERSE_PROXY_URL=/"
- "bunkerized-nginx.REVERSE_PROXY_HOST=http://myapp1:3000"
networks:
myappnet:
aliases:
- myapp1
myapp2:
build: js-app
restart: always
environment:
- NODE_ENV=production
labels:
- "bunkerized-nginx.SERVER_NAME=app2.example.com" # replace with your domain
- "bunkerized-nginx.REVERSE_PROXY_URL=/"
- "bunkerized-nginx.REVERSE_PROXY_HOST=http://myapp2:3000"
networks:
myappnet:
aliases:
- myapp2
myapp3:
build: js-app
restart: always
environment:
- NODE_ENV=production
labels:
- "bunkerized-nginx.SERVER_NAME=app3.example.com" # replace with your domain
- "bunkerized-nginx.REVERSE_PROXY_URL=/"
- "bunkerized-nginx.REVERSE_PROXY_HOST=http://myapp3:3000"
networks:
myappnet:
aliases:
- myapp3
networks:
myphpnet:
external:
name: myphpnet

View File

@@ -25,6 +25,8 @@ services:
- USE_REVERSE_PROXY=yes
labels:
- "bunkerized-nginx.AUTOCONF"
networks:
- myappnet
myautoconf:
image: bunkerity/bunkerized-nginx-autoconf
@@ -34,39 +36,10 @@ services:
- autoconf:/etc/nginx
depends_on:
- mywww
- myapp1
- myapp2
- myapp3
myapp1:
build: js-app
restart: always
environment:
- NODE_ENV=production
labels:
- "bunkerized-nginx.SERVER_NAME=app1.example.com" # replace with your domain
- "bunkerized-nginx.REVERSE_PROXY_URL=/"
- "bunkerized-nginx.REVERSE_PROXY_HOST=http://myapp1:3000"
myapp2:
build: js-app
restart: always
environment:
- NODE_ENV=production
labels:
- "bunkerized-nginx.SERVER_NAME=app2.example.com" # replace with your domain
- "bunkerized-nginx.REVERSE_PROXY_URL=/"
- "bunkerized-nginx.REVERSE_PROXY_HOST=http://myapp2:3000"
myapp3:
build: js-app
restart: always
environment:
- NODE_ENV=production
labels:
- "bunkerized-nginx.SERVER_NAME=app3.example.com" # replace with your domain
- "bunkerized-nginx.REVERSE_PROXY_URL=/"
- "bunkerized-nginx.REVERSE_PROXY_HOST=http://myapp3:3000"
volumes:
autoconf:
networks:
myappnet:
name: myappnet