-
Notifications
You must be signed in to change notification settings - Fork 389
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhance front build perf + update Dockerfile
* add vite config to avoir useless resolving * add asyncio for better perf * Dockerfile we build front and remove client folder from container
- Loading branch information
Showing
7 changed files
with
146 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,9 @@ RUN export MAKEFLAGS="-j$(nproc)" && \ | |
pip install --no-cache-dir --require-hashes --break-system-packages -r /tmp/requirements-deps.txt && \ | ||
pip install --no-cache-dir --require-hashes --target deps/python $(for file in $(ls /tmp/req/requirements*.txt) ; do echo "-r ${file}" ; done | xargs) | ||
|
||
# Install node and npm to build vite frontend | ||
RUN apk add --no-cache nodejs npm | ||
|
||
# Copy files | ||
# can't exclude specific files/dir from . so we are copying everything by hand | ||
COPY src/common/api api | ||
|
@@ -34,6 +37,13 @@ COPY src/common/templates templates | |
COPY src/ui ui | ||
COPY src/VERSION VERSION | ||
|
||
# This will build the frontend and add files to the UI folder | ||
WORKDIR /usr/share/bunkerweb/ui/client | ||
RUN python3 build.py | ||
|
||
# We can delete the client folder after building the frontend | ||
RUN rm -rf /usr/share/bunkerweb/ui/client | ||
|
||
FROM python:3.12.4-alpine3.19@sha256:ef3397d09070efd36583e83d2619cf8006158641e5b6b629d4d92a9778f5aa1c | ||
|
||
# Set default umask to prevent huge recursive chmod increasing the final image size | ||
|
@@ -53,7 +63,7 @@ RUN apk add --no-cache bash unzip libmagic mariadb-connector-c mariadb-client po | |
mkdir -p /data/cache && ln -s /data/cache /var/cache/bunkerweb && \ | ||
mkdir -p /data/lib && ln -s /data/lib /var/lib/bunkerweb && \ | ||
for dir in $(echo "pro configs plugins") ; do mkdir -p "/data/${dir}" && ln -s "/data/${dir}" "/etc/bunkerweb/${dir}" ; done && \ | ||
for dir in $(echo "pro/plugins configs/http configs/stream configs/server-http configs/server-stream configs/default-server-http configs/default-server-stream configs/modsec configs/modsec-crs configs/crs-plugins-before configs/crs-plugins-after") ; do mkdir "/data/${dir}" ; done && \ | ||
for dir in $(echo "pro/plugins configs/http configs/stream configs/server-http configs/server-stream configs/default-server-http configs/default-server-stream configs/modsec configs/modsec-crs") ; do mkdir "/data/${dir}" ; done && \ | ||
chown -R root:ui INTEGRATION /data /var/cache/bunkerweb /var/lib/bunkerweb /etc/bunkerweb /var/tmp/bunkerweb /var/run/bunkerweb /var/log/bunkerweb && \ | ||
chmod -R 770 /data /var/cache/bunkerweb /var/lib/bunkerweb /etc/bunkerweb /var/tmp/bunkerweb /var/run/bunkerweb /var/log/bunkerweb && \ | ||
chmod 750 gen/*.py ui/*.py ui/src/*.py helpers/*.sh deps/python/bin/* && \ | ||
|
@@ -66,7 +76,7 @@ RUN apk add --no-cache "busybox>=1.36.1-r17" "busybox-binsh>=1.36.1-r17" "ssl_cl | |
RUN apk add --no-cache "libcrypto3>=3.1.6-r0" "libssl3>=3.1.6-r0" # CVE-2024-4741 CVE-2024-5535 | ||
|
||
LABEL maintainer="Bunkerity <[email protected]>" | ||
LABEL version="1.6.0-beta" | ||
LABEL version="1.5.9" | ||
LABEL url="https://www.bunkerweb.io" | ||
LABEL bunkerweb.type="ui" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/x-icon" href="img/favicon.ico" /> | ||
<link rel="stylesheet" href="css/style.css" /> | ||
<link rel="stylesheet" href="css/flag-icons.min.css" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>BunkerWeb | DASHBOARD</title> | ||
<script nonce="{{ script_nonce }}" type="module" crossorigin src="assets/home-098d38b3.js"></script> | ||
<link rel="modulepreload" crossorigin href="assets/Title-9ae7a316.js"> | ||
</head> | ||
|
||
<body> | ||
{% set data_server_flash = [] %} | ||
{% with messages = get_flashed_messages(with_categories=true) %} | ||
{% for category, message in messages %} | ||
{% if data_server_flash.append({"type": "error" if category == "error" else "success", "title": "dashboard_error" if category == "error" else "dashboard_success", "message": message}) %}{% endif %} | ||
{% endfor %} | ||
{% endwith %} | ||
<div class='hidden' data-csrf-token='{{ csrf_token() }}'></div> | ||
<div class='hidden' data-server-global='{{data_server_global if data_server_global else {}}}'></div> | ||
<div class='hidden' data-server-flash='{{data_server_flash|tojson}}'></div> | ||
<div class='hidden' data-server-builder='{{data_server_builder[1:-1]}}'></div> | ||
<div id='app'></div> | ||
</body> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/x-icon" href="img/favicon.ico" /> | ||
<link rel="stylesheet" href="css/style.css" /> | ||
<link rel="stylesheet" href="css/flag-icons.min.css" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>BunkerWeb | DASHBOARD</title> | ||
<script type="module" crossorigin nonce="{{ script_nonce }}" src="assets/home-BnrNYFnz.js"></script> | ||
<link rel="modulepreload" crossorigin nonce="{{ script_nonce }}" href="assets/Title-B_4IDnhH.js"> | ||
</head> | ||
<body> | ||
{% set data_server_flash = [] %} | ||
{% with messages = get_flashed_messages(with_categories=true) %} | ||
{% for category, message in messages %} | ||
{% if data_server_flash.append({"type": "error" if category == "error" else "success", "title": "dashboard_error" if category == "error" else "dashboard_success", "message": message}) %}{% endif %} | ||
{% endfor %} | ||
{% endwith %} | ||
<div class='hidden' data-csrf-token='{{ csrf_token() }}'></div> | ||
<div class='hidden' data-server-global='{{data_server_global if data_server_global else {}}}'></div> | ||
<div class='hidden' data-server-flash='{{data_server_flash|tojson}}'></div> | ||
<div class='hidden' data-server-builder='{{data_server_builder[1:-1]}}'></div> | ||
<div id='app'></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/x-icon" href="img/favicon.ico" /> | ||
<link rel="stylesheet" href="css/style.css" /> | ||
<link rel="stylesheet" href="css/flag-icons.min.css" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>BunkerWeb | DASHBOARD</title> | ||
<script nonce="{{ script_nonce }}" type="module" crossorigin src="assets/instances-32f9ed21.js"></script> | ||
<link rel="modulepreload" crossorigin href="assets/Title-9ae7a316.js"> | ||
</head> | ||
|
||
<body> | ||
{% set data_server_flash = [] %} | ||
{% with messages = get_flashed_messages(with_categories=true) %} | ||
{% for category, message in messages %} | ||
{% if data_server_flash.append({"type": "error" if category == "error" else "success", "title": "dashboard_error" if category == "error" else "dashboard_success", "message": message}) %}{% endif %} | ||
{% endfor %} | ||
{% endwith %} | ||
<div class='hidden' data-csrf-token='{{ csrf_token() }}'></div> | ||
<div class='hidden' data-server-global='{{data_server_global if data_server_global else {}}}'></div> | ||
<div class='hidden' data-server-flash='{{data_server_flash|tojson}}'></div> | ||
<div class='hidden' data-server-builder='{{data_server_builder[1:-1]}}'></div> | ||
<div id='app'></div> | ||
</body> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/x-icon" href="img/favicon.ico" /> | ||
<link rel="stylesheet" href="css/style.css" /> | ||
<link rel="stylesheet" href="css/flag-icons.min.css" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>BunkerWeb | DASHBOARD</title> | ||
<script type="module" crossorigin nonce="{{ script_nonce }}" src="assets/instances-DfV5PghU.js"></script> | ||
<link rel="modulepreload" crossorigin nonce="{{ script_nonce }}" href="assets/Title-B_4IDnhH.js"> | ||
</head> | ||
<body> | ||
{% set data_server_flash = [] %} | ||
{% with messages = get_flashed_messages(with_categories=true) %} | ||
{% for category, message in messages %} | ||
{% if data_server_flash.append({"type": "error" if category == "error" else "success", "title": "dashboard_error" if category == "error" else "dashboard_success", "message": message}) %}{% endif %} | ||
{% endfor %} | ||
{% endwith %} | ||
<div class='hidden' data-csrf-token='{{ csrf_token() }}'></div> | ||
<div class='hidden' data-server-global='{{data_server_global if data_server_global else {}}}'></div> | ||
<div class='hidden' data-server-flash='{{data_server_flash|tojson}}'></div> | ||
<div class='hidden' data-server-builder='{{data_server_builder[1:-1]}}'></div> | ||
<div id='app'></div> | ||
</body> | ||
</html> |