Skip to content

[BUG] Docker-Compose setup #1466

Closed
Closed

Description

@alwinhb

What happened?

I am trying to setup the complete stack using docker-compose, I have added my compose.yaml

Kindly guide/suggest if my compose file is ok or needs to be updated.

How to reproduce?

docker-compose up

Configuration file(s) (yaml or .env)

version: "3.5"

services:
  bunkerweb:
    image: bunkerity/bunkerweb:1.5.9
    ports:
      - 80:8080
      - 443:8443
    labels:
      - "bunkerweb.INSTANCE=yes"
    environment:
      - SERVER_NAME=www.example.com
      - API_WHITELIST_IP=127.0.0.0/8 10.20.30.0/24
    networks:
      - bw-universe
      - bw-services

  bw-scheduler:
    image: bunkerity/bunkerweb-scheduler:1.5.9
    depends_on:
      - bunkerweb
      - bw-docker
    volumes:
      - bw-data:/data
    environment:
      - DOCKER_HOST=tcp://bw-docker:2375
    networks:
      - bw-universe
      - bw-docker

  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

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

Relevant log output

bunker_waf-bw-scheduler-1  | Traceback (most recent call last):
bunker_waf-bw-scheduler-1  |   File "/usr/local/lib/python3.12/pathlib.py", line 1311, in mkdir
bunker_waf-bw-scheduler-1  |     os.mkdir(self, mode)
bunker_waf-bw-scheduler-1  | FileExistsError: [Errno 17] File exists: '/var/cache/bunkerweb'
bunker_waf-bw-scheduler-1  | 
bunker_waf-bw-scheduler-1  | During handling of the above exception, another exception occurred:
bunker_waf-bw-scheduler-1  | 
bunker_waf-bw-scheduler-1  | Traceback (most recent call last):
bunker_waf-bw-scheduler-1  |   File "/usr/share/bunkerweb/scheduler/main.py", line 41, in <module>
bunker_waf-bw-scheduler-1  | 
bunker_waf-bw-scheduler-1  |     CACHE_PATH.mkdir(parents=True, exist_ok=True)
bunker_waf-bw-scheduler-1  |   File "/usr/local/lib/python3.12/pathlib.py", line 1320, in mkdir
bunker_waf-bw-scheduler-1  |     if not exist_ok or not self.is_dir():
bunker_waf-bw-scheduler-1  |                            ^^^^^^^^^^^^^
bunker_waf-bw-scheduler-1  |   File "/usr/local/lib/python3.12/pathlib.py", line 875, in is_dir
bunker_waf-bw-scheduler-1  |     return S_ISDIR(self.stat().st_mode)
bunker_waf-bw-scheduler-1  |                    ^^^^^^^^^^^
bunker_waf-bw-scheduler-1  |   File "/usr/local/lib/python3.12/pathlib.py", line 840, in stat
bunker_waf-bw-scheduler-1  |     return os.stat(self, follow_symlinks=follow_symlinks)
bunker_waf-bw-scheduler-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bunker_waf-bw-scheduler-1  | PermissionError: [Errno 13] Permission denied: '/var/cache/bunkerweb'
bunker_waf-bw-scheduler-1  | [2024-09-10 10:58:52] - ENTRYPOINT - ℹ️  - Scheduler stopped

BunkerWeb version

1.5.9

What integration are you using?

Docker

Linux distribution (if applicable)

No response

Removed private data

  • I have removed all private data from the configuration file and the logs

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. tracure1337 commented on Sep 10, 2024

    @tracure1337

    I had the same issue.

    just stop the services and delete the bunkerweb volume.

    Then restart them.

    It will regenerate all your certs and start from scratch but it will work.

  2. alwinhb commented on Sep 11, 2024

    @alwinhb
    Author

    I still get this error Access denied for user 'bunkerweb'@'{MY_IP_ADD}

    Can you add your compose file?

    @cocoonkid

    @ff6347 @adren @FacundoAcevedo

  3. fl0ppy-d1sk commented on Sep 16, 2024

    @fl0ppy-d1sk
    Member

    Hello @alwinhb,

    Can you try docker compose down -v before starting the stack ? (-v is important)

  4. alwinhb commented on Sep 16, 2024

    @alwinhb
    Author

    @fl0ppy-d1sk Thanks it worked

    Now as i go to http://localhost:7000

    As i add the admin username and password, I see this error Wrong CSRF token !

    Also I tried using http://localhost:7000/setup but it routes again to http://localhost:7000/login

    Can you guide on this error

    @ff6347 @adren @FacundoAcevedo

  5. TheophileDiot commented on Oct 21, 2024

    @TheophileDiot
    Member

    Hi @alwinhb, sorry for the late response. Did you have a look at this ?
    https://docs.bunkerweb.io/latest/web-ui/#advanced-installation

  6. alwinhb commented on Oct 22, 2024

    @alwinhb
    Author

    @TheophileDiot
    I am unable to see login page using the compose yaml available at this link.

    I get 403 error using below yaml

    version: "3.5"
    
    services:
      bunkerweb:
        image: bunkerity/bunkerweb:1.5.10
        ports:
          - 80:8080
          - 443:8443
        labels:
          - "bunkerweb.INSTANCE=yes"
        environment:
          - SERVER_NAME=www.example.com
          - MULTISITE=yes
          - DATABASE_URI=mariadb+pymysql://bunkerweb:changeme@bw-db:3306/db # Remember to set a stronger password for the database
          - API_WHITELIST_IP=127.0.0.0/8 10.20.30.0/24
          - DISABLE_DEFAULT_SERVER=yes
          - USE_CLIENT_CACHE=yes
          - USE_GZIP=yes
          - www.example.com_USE_UI=yes
          - www.example.com_USE_REVERSE_PROXY=yes
          - www.example.com_REVERSE_PROXY_URL=/changeme
          - www.example.com_REVERSE_PROXY_HOST=http://bw-ui:7000
          - www.example.com_INTERCEPTED_ERROR_CODES=400 404 405 413 429 500 501 502 503 504
          - www.example.com_MAX_CLIENT_SIZE=50m
        networks:
          - bw-universe
          - bw-services
    
      bw-scheduler:
        image: bunkerity/bunkerweb-scheduler:1.5.10
        depends_on:
          - bunkerweb
          - bw-docker
        environment:
          - DATABASE_URI=mariadb+pymysql://bunkerweb:changeme@bw-db:3306/db # Remember to set a stronger password for the database
          - DOCKER_HOST=tcp://bw-docker:2375
        networks:
          - bw-universe
          - bw-docker
    
      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
    
      bw-ui:
        image: bunkerity/bunkerweb-ui:1.5.10
        depends_on:
          - bw-docker
        environment:
          - DATABASE_URI=mariadb+pymysql://bunkerweb:changeme@bw-db:3306/db # Remember to set a stronger password for the database
          - DOCKER_HOST=tcp://bw-docker:2375
          - ADMIN_USERNAME=changeme
          - ADMIN_PASSWORD=changeme # Remember to set a stronger password for the changeme user
        networks:
          - bw-universe
          - bw-docker
    
      bw-db:
        image: mariadb:10.10
        environment:
          - MYSQL_RANDOM_ROOT_PASSWORD=yes
          - MYSQL_DATABASE=db
          - MYSQL_USER=bunkerweb
          - MYSQL_PASSWORD=changeme # Remember to set a stronger password for the database
        volumes:
          - bw-data:/var/lib/mysql
        networks:
          - bw-docker
    
    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
        
    
  7. TheophileDiot commented on Oct 22, 2024

    @TheophileDiot
    Member

    @alwinhb how do you access the web UI ?

  8. alwinhb commented on Oct 22, 2024

    @alwinhb
    Author

    @TheophileDiot localhost:8080

    Little change in my docker compose

       ports:
          - 8080:8080
          - 443:8443
          
          ```
    
  9. TheophileDiot commented on Oct 22, 2024

    @TheophileDiot
    Member

    Do you try to access it via https://your-ip-address-or-fqdn/changeme ?

  10. alwinhb commented on Oct 22, 2024

    @alwinhb
    Author

    Yeah and I get - Access is forbidden to the requested page

    @TheophileDiot

  11. TheophileDiot commented on Oct 23, 2024

    @TheophileDiot
    Member

    @alwinhb Did you edit your hosts file by adding this entry ?

    127.0.0.1 www.example.com
    

    If not that's the issue, you should be able to access the web UI via https://www.example.com/changeme afterward

  12. alwinhb commented on Oct 24, 2024

    @alwinhb
    Author

    @TheophileDiot - This issue is resolved - "Access is forbidden now",

    But now I get a blank page with text - "Nothing to see here"

    I want to setup and add my configurations but I don't see setup page with /setup.

  13. TheophileDiot commented on Oct 24, 2024

    @TheophileDiot
    Member

    @alwinhb if you want to use the setup wizard, you have to follow this tutorial : https://docs.bunkerweb.io/latest/web-ui/#setup-wizard

  14. alwinhb commented on Oct 25, 2024

    @alwinhb
    Author

    @TheophileDiot Thanks for the link, I tried using the docker compose yaml present at this link but Still I get - "Nothing to see here"

    Can you guide me with the right docker compose.yaml that I can use for my local setup?

  15. locked and limited conversation to collaborators on Oct 25, 2024
  16. converted this issue into a discussion #1619 on Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions