How to configure bunkerweb in docker environment

Hi all,

i’m new here, but i have a simple question, i’m trying to configure bunkerweb v1.6.15 in docker but i can’t get it work like i want

just to let you understand what i’m trying to do i explain my setup:

i have 2 VMs with keepalive on just to delivery public IPs for my websites (around 50+) and i want to protect them with bunkerweb, anubis, crowdsec all of these in docker, i also have a keydb with replica active-active between these 2 servers (in docker always) so all the docker can store keys to them.

Another important point is that i don’t want to use bunkerweb_ui (web gui) and bunkerweb_scheduler, but just bunkerweb docker image directly.

Also i don’t want to use a DB in this configuration if possible (i would use a Galera Cluster with my setup and i don’t want).

All this is managed by ansible project and i will use it for future projects so i prefer to use configuration files or env files.

Now the part that doesn’t work, i want bunkerweb protect my websites using if i want 50+ different configurations so i have to use the MULTISITE mode, i created an env file with all the settings for my websites but seems that bunkerweb doesn’t load it.

this is my docker-compose file:

services:
  bunkerweb:
    image: bunkerity/bunkerweb:1.6.15
    container_name: "bunkerweb"
    restart: always
    ports:
      - "80:8080"
      - "443:8443"

    env_file:
      - /opt/docker/bunkerweb/conf/websites-config.env

    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /opt/docker/bunkerweb/certs:/ssl:ro
      
    ulimits:
      nofile:
        soft: 65536
        hard: 524288

    networks:
      - keydb_network
      - anubis_network

    logging:
      driver: "journald"
      options:
        tag: "bunkerweb"

    healthcheck:
      # Esecute native script to check BunkerWeb is working
      test: ["CMD-SHELL", "/usr/share/bunkerweb/helpers/healthcheck.sh"]
      # Control interval (each 30 seconds)
      interval: 30s
      # Max time to wait for an answer before considering it failed
      timeout: 5s
      # Number of following failed attemps before to sign the container like "unhealthy"
      retries: 3
      # Starting time before beginning the check, it is needed to bunkerweb to start
      start_period: 20s

networks:
  keydb_network:
    name: keydb_network
    external: true
  anubis_network:
    name: anubis_network
    external: true

this my /opt/docker/bunkerweb/conf/websites-config.env file

# AI variables to have more info
LOG_LEVEL=DEBUG
NGINX_LOG_LEVEL_ERROR=debug
MODSECURITY_LOG_LEVEL=9

# MULTISITE configuration
MULTISITE=yes

# CROWDSEC integration
USE_CROWDSEC=no

# REDIS/KEYDB configuration
# force bunkerweb to send reports and configuration to keydb
USE_REDIS=yes
REDIS_HOST=keydb
REDIS_PORT=6379
REDIS_DATABASE=1
REDIS_PASSWORD=mykeydbpassword

LOG_LEVEL=info

# LIST of websites protected
SERVER_NAME=www.example.com

# www.example.com SSL configuration
www.example.com_USE_CUSTOM_SSL=yes
www.example.com_CUSTOM_SSL_CERT=/ssl/www.example.com.chain.crt
www.example.com_CUSTOM_SSL_KEY=/ssl/www.example.com.key

# www.example.com Anubis routing
www.example.com_USE_REVERSE_PROXY=yes
www.example.com_REVERSE_PROXY_URL=/
www.example.com_REVERSE_PROXY_HOST=http://anubis-www.example.com:8000

i will have one anubis docker for each websites

Now the questions, bunkerweb docker starts without problems but:

if i check with docker compose exec bunkerweb ls -la /etc/bunkerweb/configs/ i get

total 48
drwxrwx---   11 root     nginx         4096 Sep 21 10:15 .
drwxrwx---    1 root     nginx         4096 Sep 21 10:15 ..
drwxrwx---    2 root     nginx         4096 Sep 21 10:15 crs-plugins-after
drwxrwx---    2 root     nginx         4096 Sep 21 10:15 crs-plugins-before
drwxrwx---    2 root     nginx         4096 Sep 21 10:15 default-server-http
drwxrwx---    2 root     nginx         4096 Sep 21 10:15 http
drwxrwx---    2 root     nginx         4096 Sep 21 10:15 modsec
drwxrwx---    2 root     nginx         4096 Sep 21 10:15 modsec-crs
drwxrwx---    2 root     nginx         4096 Sep 21 10:15 server-http
drwxrwx---    2 root     nginx         4096 Sep 21 10:15 server-stream
drwxrwx---    2 root     nginx         4096 Sep 21 10:15 stream

no config for my website, if i check the logs with docker compose logs i got no information about MULTISITE, www.example.com or REDIS configuration or anubis configuration (anubis is running but not with the name is referred in the env configuration

i can’t find what is wrong or some documentation how to configure bunkerweb docker in this way

if someone has some hints is welcome and i will thanks anyone will help me

Claudio