Skip to content

Commit

Permalink
Finish creating is-pro compose files and env files
Browse files Browse the repository at this point in the history
  • Loading branch information
TheophileDiot committed Apr 5, 2024
1 parent 41571b0 commit f97db77
Show file tree
Hide file tree
Showing 14 changed files with 611 additions and 0 deletions.
6 changes: 6 additions & 0 deletions misc/dev/configs/server-http/hello.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
location /hello {
default_type 'text/plain';
content_by_lua_block {
ngx.say('Hello World!')
}
}
131 changes: 131 additions & 0 deletions misc/dev/docker-compose.autoconf.misc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
x-env: &env
DATABASE_URI: "mariadb+pymysql://bunkerweb:secret@bw-db:3306/db"
DOCKER_HOST: "tcp://bw-docker:2375"
AUTOCONF_MODE: "yes"
LOG_LEVEL: "debug"

services:
bunkerweb:
build:
context: ../..
dockerfile: ./src/bw/Dockerfile
ports:
- 80:8080
- 443:8443
labels:
- "bunkerweb.INSTANCE=yes"
environment:
- SERVER_NAME=
- MULTISITE=yes
- API_WHITELIST_IP=127.0.0.0/24 10.20.30.0/24
- AUTOCONF_MODE=yes
- USE_BUNKERNET=no
- USE_BLACKLIST=no
- USE_WHITELIST=no
- SEND_ANONYMOUS_REPORT=no
- LOG_LEVEL=info
- SERVE_FILES=no
- DISABLE_DEFAULT_SERVER=yes
- USE_CLIENT_CACHE=yes
- USE_GZIP=yes
- EXTERNAL_PLUGIN_URLS=https://github.com/bunkerity/bunkerweb-plugins/archive/refs/heads/dev.zip
- CUSTOM_CONF_MODSEC_CRS_reqbody-rule=SecRuleRemoveById 200002
networks:
bw-universe:
aliases:
- bunkerweb
bw-services:
aliases:
- bunkerweb

bw-autoconf:
build:
context: ../..
dockerfile: ./src/autoconf/Dockerfile
depends_on:
- bunkerweb
- bw-docker
environment:
<<: *env
networks:
bw-universe:
aliases:
- bw-autoconf
bw-docker:
aliases:
- bw-autoconf

bw-scheduler:
build:
context: ../..
dockerfile: ./src/scheduler/Dockerfile
depends_on:
- bunkerweb
- bw-docker
volumes:
- bw-data:/data
- ./configs/server-http/hello.conf:/data/configs/server-http/hello.conf:ro
environment:
<<: *env
networks:
bw-universe:
aliases:
- bw-scheduler
bw-docker:
aliases:
- bw-scheduler

bw-docker:
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:
aliases:
- bw-docker

bw-db:
image: mariadb:11
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=yes
- MYSQL_DATABASE=db
- MYSQL_USER=bunkerweb
- MYSQL_PASSWORD=secret
volumes:
- bw-db:/var/lib/mysql
networks:
bw-docker:
aliases:
- bw-db

app1:
image: nginxdemos/nginx-hello
networks:
bw-services:
aliases:
- app1
labels:
- "bunkerweb.SERVER_NAME=app1.example.com"
- "bunkerweb.USE_REVERSE_PROXY=yes"
- "bunkerweb.REVERSE_PROXY_URL=/"
- "bunkerweb.REVERSE_PROXY_HOST=http://app1:8080"
- bunkerweb.CUSTOM_CONF_MODSEC_CRS_ip-host=SecRuleRemoveById 920350

volumes:
bw-data:
bw-db:

networks:
bw-universe:
name: bw-universe
ipam:
driver: default
config:
- subnet: 10.20.30.0/24
bw-services:
name: bw-services
bw-docker:
name: bw-docker
166 changes: 166 additions & 0 deletions misc/dev/docker-compose.autoconf.ui.misc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
x-env: &env
DATABASE_URI: "mariadb+pymysql://bunkerweb:secret@bw-db:3306/db"
DOCKER_HOST: "tcp://bw-docker:2375"
AUTOCONF_MODE: "yes"
LOG_LEVEL: "debug"

services:
bunkerweb:
build:
context: ../..
dockerfile: ./src/bw/Dockerfile
ports:
- 80:8080
- 443:8443
labels:
- "bunkerweb.INSTANCE=yes"
environment:
- SERVER_NAME=
- MULTISITE=yes
- API_WHITELIST_IP=127.0.0.0/24 10.20.30.0/24
- AUTOCONF_MODE=yes
- USE_BUNKERNET=no
- USE_BLACKLIST=no
- USE_WHITELIST=no
- SEND_ANONYMOUS_REPORT=no
- LOG_LEVEL=info
- SERVE_FILES=no
- DISABLE_DEFAULT_SERVER=yes
- USE_CLIENT_CACHE=yes
- USE_GZIP=yes
- EXTERNAL_PLUGIN_URLS=https://github.com/bunkerity/bunkerweb-plugins/archive/refs/heads/dev.zip
- CUSTOM_CONF_MODSEC_CRS_reqbody-rule=SecRuleRemoveById 200002
networks:
bw-universe:
aliases:
- bunkerweb
bw-services:
aliases:
- bunkerweb

bw-autoconf:
build:
context: ../..
dockerfile: ./src/autoconf/Dockerfile
depends_on:
- bunkerweb
- bw-docker
environment:
<<: *env
networks:
bw-universe:
aliases:
- bw-autoconf
bw-docker:
aliases:
- bw-autoconf

bw-scheduler:
build:
context: ../..
dockerfile: ./src/scheduler/Dockerfile
depends_on:
- bunkerweb
- bw-docker
volumes:
- bw-data:/data
- ./configs/server-http/hello.conf:/data/configs/server-http/hello.conf:ro
environment:
<<: *env
networks:
bw-universe:
aliases:
- bw-scheduler
bw-docker:
aliases:
- bw-scheduler

bw-docker:
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:
aliases:
- bw-docker

bw-ui:
build:
context: ../..
dockerfile: ./src/ui/Dockerfile
command: python -m flask --app main:app run --host=0.0.0.0 --port=7000
depends_on:
- bw-docker
volumes:
- ../../src/ui/src:/usr/share/bunkerweb/ui/src:ro
- ../../src/ui/static:/usr/share/bunkerweb/ui/static:ro
- ../../src/ui/templates:/usr/share/bunkerweb/ui/templates:ro
- ../../src/ui/main.py:/usr/share/bunkerweb/ui/main.py:ro
- ../../src/ui/utils.py:/usr/share/bunkerweb/ui/utils.py:ro
environment:
<<: *env
ADMIN_USERNAME: "admin"
ADMIN_PASSWORD: "P@ssw0rd"
FLASK_APP: "main.py"
FLASK_DEBUG: "1"
FLASK_ENV: "development"
networks:
bw-universe:
aliases:
- bw-ui
bw-docker:
aliases:
- bw-ui
labels:
- "bunkerweb.SERVER_NAME=www.example.com"
- "bunkerweb.USE_UI=yes"
- "bunkerweb.USE_REVERSE_PROXY=yes"
- "bunkerweb.REVERSE_PROXY_URL=/admin"
- "bunkerweb.REVERSE_PROXY_HOST=http://bw-ui:7000"
- "bunkerweb.INTERCEPTED_ERROR_CODES=400 404 405 413 429 500 501 502 503 504"
- bunkerweb.CUSTOM_CONF_MODSEC_CRS_ip-host=SecRuleRemoveById 920350

bw-db:
image: mariadb:11
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=yes
- MYSQL_DATABASE=db
- MYSQL_USER=bunkerweb
- MYSQL_PASSWORD=secret
volumes:
- bw-db:/var/lib/mysql
networks:
bw-docker:
aliases:
- bw-db

app1:
image: nginxdemos/nginx-hello
networks:
bw-services:
aliases:
- app1
labels:
- "bunkerweb.SERVER_NAME=app1.example.com"
- "bunkerweb.USE_REVERSE_PROXY=yes"
- "bunkerweb.REVERSE_PROXY_URL=/"
- "bunkerweb.REVERSE_PROXY_HOST=http://app1:8080"

volumes:
bw-data:
bw-db:

networks:
bw-universe:
name: bw-universe
ipam:
driver: default
config:
- subnet: 10.20.30.0/24
bw-services:
name: bw-services
bw-docker:
name: bw-docker
89 changes: 89 additions & 0 deletions misc/dev/docker-compose.misc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
services:
bunkerweb:
build:
context: ../..
dockerfile: ./src/bw/Dockerfile
ports:
- 80:8080
- 443:8443
labels:
- "bunkerweb.INSTANCE=yes"
environment:
- SERVER_NAME=app1.example.com
- API_WHITELIST_IP=127.0.0.0/24 10.20.30.0/24
- USE_BUNKERNET=no
- USE_BLACKLIST=no
- USE_WHITELIST=no
- SEND_ANONYMOUS_REPORT=no
- LOG_LEVEL=info
- SERVE_FILES=no
- DISABLE_DEFAULT_SERVER=yes
- USE_CLIENT_CACHE=yes
- USE_GZIP=yes
- USE_REVERSE_PROXY=yes
- REVERSE_PROXY_URL=/
- REVERSE_PROXY_HOST=http://app1:8080
- EXTERNAL_PLUGIN_URLS=https://github.com/bunkerity/bunkerweb-plugins/archive/refs/heads/dev.zip
- CUSTOM_CONF_MODSEC_CRS_reqbody-suppress=SecRuleRemoveById 200002
networks:
bw-universe:
aliases:
- bunkerweb
bw-services:
aliases:
- bunkerweb

bw-scheduler:
build:
context: ../..
dockerfile: ./src/scheduler/Dockerfile
depends_on:
- bunkerweb
- bw-docker
volumes:
- bw-data:/data
- ./configs/server-http/hello.conf:/data/configs/server-http/hello.conf:ro
environment:
- DOCKER_HOST=tcp://bw-docker:2375
- LOG_LEVEL=debug
networks:
bw-universe:
aliases:
- bw-scheduler
bw-docker:
aliases:
- bw-scheduler

bw-docker:
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:
aliases:
- bw-docker

app1:
image: nginxdemos/nginx-hello
networks:
bw-services:
aliases:
- app1

volumes:
bw-data:

networks:
bw-universe:
name: bw-universe
ipam:
driver: default
config:
- subnet: 10.20.30.0/24
bw-services:
name: bw-services
bw-docker:
name: bw-docker
Loading

0 comments on commit f97db77

Please sign in to comment.