diff --git a/src/linux/Dockerfile-debian b/src/linux/Dockerfile-debian index a7220eea7..ab59055a9 100644 --- a/src/linux/Dockerfile-debian +++ b/src/linux/Dockerfile-debian @@ -37,10 +37,7 @@ WORKDIR /usr/share/bunkerweb RUN export MAKEFLAGS="-j$(nproc)" && \ mkdir -p deps/python && \ pip install --break-system-packages --no-cache-dir --require-hashes --ignore-installed -r /tmp/requirements-deps.txt && \ - pip install --break-system-packages --no-cache-dir --require-hashes --force-reinstall --target deps/python $(for file in $(ls /tmp/req/requirements*.txt) ; do echo "-r ${file}" ; done | xargs) && \ - if [ ! -f deps/python/zope/__init__.py ]; then \ - touch deps/python/zope/__init__.py; \ - fi # Ensure __init__.py exists to avoid import failures + pip install --break-system-packages --no-cache-dir --require-hashes --force-reinstall --target deps/python $(for file in $(ls /tmp/req/requirements*.txt) ; do echo "-r ${file}" ; done | xargs) # Copy files # can't exclude deps from . so we are copying everything by hand diff --git a/src/linux/Dockerfile-fedora b/src/linux/Dockerfile-fedora index 0797db3ae..8abc62683 100644 --- a/src/linux/Dockerfile-fedora +++ b/src/linux/Dockerfile-fedora @@ -33,10 +33,7 @@ WORKDIR /usr/share/bunkerweb RUN export MAKEFLAGS="-j$(nproc)" && \ mkdir -p deps/python && \ pip install --no-cache-dir --require-hashes --ignore-installed -r /tmp/requirements-deps.txt && \ - pip install --no-cache-dir --require-hashes --force-reinstall --target deps/python $(for file in $(ls /tmp/req/requirements*.txt) ; do echo "-r ${file}" ; done | xargs) && \ - if [ ! -f deps/python/zope/__init__.py ]; then \ - touch deps/python/zope/__init__.py; \ - fi # Ensure __init__.py exists to avoid import failures + pip install --no-cache-dir --require-hashes --force-reinstall --target deps/python $(for file in $(ls /tmp/req/requirements*.txt) ; do echo "-r ${file}" ; done | xargs) # Copy files # can't exclude deps from . so we are copying everything by hand diff --git a/src/linux/Dockerfile-rhel b/src/linux/Dockerfile-rhel index 25017bbcc..6a4cebe4c 100644 --- a/src/linux/Dockerfile-rhel +++ b/src/linux/Dockerfile-rhel @@ -44,10 +44,7 @@ RUN export MAKEFLAGS="-j$(nproc)" && \ mkdir -p deps/python && \ easy_install-3.9 pip && \ pip install --no-cache-dir --require-hashes --ignore-installed -r /tmp/requirements-deps.txt && \ - pip install --no-cache-dir --require-hashes --force-reinstall --target deps/python $(for file in $(ls /tmp/req/requirements*.txt) ; do echo "-r ${file}" ; done | xargs) && \ - if [ ! -f deps/python/zope/__init__.py ]; then \ - touch deps/python/zope/__init__.py; \ - fi # Ensure __init__.py exists to avoid import failures + pip install --no-cache-dir --require-hashes --force-reinstall --target deps/python $(for file in $(ls /tmp/req/requirements*.txt) ; do echo "-r ${file}" ; done | xargs) # Copy files # can't exclude deps from . so we are copying everything by hand diff --git a/src/linux/Dockerfile-rhel9 b/src/linux/Dockerfile-rhel9 index 93145e0a2..41d7314d8 100644 --- a/src/linux/Dockerfile-rhel9 +++ b/src/linux/Dockerfile-rhel9 @@ -45,10 +45,7 @@ RUN export MAKEFLAGS="-j$(nproc)" && \ mkdir -p deps/python && \ python3 -m ensurepip --upgrade && \ python3 -m pip install --no-cache-dir --require-hashes --ignore-installed -r /tmp/requirements-deps.txt && \ - python3 -m pip install --no-cache-dir --require-hashes --force-reinstall --target deps/python $(for file in $(ls /tmp/req/requirements*.txt) ; do echo "-r ${file}" ; done | xargs) && \ - if [ ! -f deps/python/zope/__init__.py ]; then \ - touch deps/python/zope/__init__.py; \ - fi # Ensure __init__.py exists to avoid import failures + python3 -m pip install --no-cache-dir --require-hashes --force-reinstall --target deps/python $(for file in $(ls /tmp/req/requirements*.txt) ; do echo "-r ${file}" ; done | xargs) # Copy files # can't exclude deps from . so we are copying everything by hand diff --git a/src/linux/Dockerfile-ubuntu b/src/linux/Dockerfile-ubuntu index d5e07babb..ec84296f6 100644 --- a/src/linux/Dockerfile-ubuntu +++ b/src/linux/Dockerfile-ubuntu @@ -37,10 +37,7 @@ WORKDIR /usr/share/bunkerweb RUN export MAKEFLAGS="-j$(nproc)" && \ mkdir -p deps/python && \ pip install --no-cache-dir --require-hashes --break-system-packages --ignore-installed -r /tmp/requirements-deps.txt && \ - pip install --no-cache-dir --require-hashes --break-system-packages --force-reinstall --target deps/python $(for file in $(ls /tmp/req/requirements*.txt) ; do echo "-r ${file}" ; done | xargs) && \ - if [ ! -f deps/python/zope/__init__.py ]; then \ - touch deps/python/zope/__init__.py; \ - fi # Ensure __init__.py exists to avoid import failures + pip install --no-cache-dir --require-hashes --break-system-packages --force-reinstall --target deps/python $(for file in $(ls /tmp/req/requirements*.txt) ; do echo "-r ${file}" ; done | xargs) # Copy files # can't exclude deps from . so we are copying everything by hand diff --git a/src/linux/Dockerfile-ubuntu-jammy b/src/linux/Dockerfile-ubuntu-jammy index cd448deb0..6a2b7a28c 100644 --- a/src/linux/Dockerfile-ubuntu-jammy +++ b/src/linux/Dockerfile-ubuntu-jammy @@ -37,10 +37,7 @@ WORKDIR /usr/share/bunkerweb RUN export MAKEFLAGS="-j$(nproc)" && \ mkdir -p deps/python && \ pip install --no-cache-dir --require-hashes --ignore-installed -r /tmp/requirements-deps.txt && \ - pip install --no-cache-dir --require-hashes --force-reinstall --target deps/python $(for file in $(ls /tmp/req/requirements*.txt) ; do echo "-r ${file}" ; done | xargs) && \ - if [ ! -f deps/python/zope/__init__.py ]; then \ - touch deps/python/zope/__init__.py; \ - fi # Ensure __init__.py exists to avoid import failures + pip install --no-cache-dir --require-hashes --force-reinstall --target deps/python $(for file in $(ls /tmp/req/requirements*.txt) ; do echo "-r ${file}" ; done | xargs) # Copy files # can't exclude deps from . so we are copying everything by hand diff --git a/src/ui/gunicorn.conf.py b/src/ui/gunicorn.conf.py index 20df9f9b9..8643b8b38 100644 --- a/src/ui/gunicorn.conf.py +++ b/src/ui/gunicorn.conf.py @@ -13,10 +13,6 @@ for deps_path in [join(sep, "usr", "share", "bunkerweb", *paths) for paths in (( if deps_path not in sys_path: sys_path.append(deps_path) -from gevent.monkey import patch_all - -patch_all() - from passlib.totp import generate_secret from logger import setup_logger # type: ignore @@ -58,7 +54,7 @@ pythonpath = join(sep, "usr", "share", "bunkerweb", "deps", "python") proxy_allow_ips = "*" casefold_http_method = True workers = MAX_WORKERS -worker_class = "gevent" +worker_class = "gthread" threads = int(getenv("MAX_THREADS", MAX_WORKERS * 2)) max_requests_jitter = min(8, MAX_WORKERS) graceful_timeout = 30