mirror of
https://github.com/louislam/uptime-kuma.git
synced 2026-11-10 21:21:19 +08:00
chore: reduce Docker image size, fix real browser and embedded MariaDB (#8040)
This commit is contained in:
1 parent
696942c12a
commit
c2522806ba
6 files changed
+33
-2
No files matched your search
@@ -1,5 +1,6 @@
|
||||
/.idea
|
||||
/node_modules
|
||||
**/node_modules
|
||||
/data*
|
||||
/out
|
||||
/test
|
||||
@@ -34,6 +35,22 @@ tsconfig.json
|
||||
/extra/exe-builder
|
||||
/extra/uptime-kuma-push
|
||||
|
||||
# Dev-only
|
||||
/AGENTS.md
|
||||
/CLAUDE.md
|
||||
/PLAN.md
|
||||
/.ws-context
|
||||
/compose.yaml
|
||||
/index.html
|
||||
/vite.config.mjs
|
||||
/playwright.config.js
|
||||
/.prettierrc.js
|
||||
/.prettierignore
|
||||
|
||||
# Only src/util.ts is used by the server at runtime
|
||||
/src/*
|
||||
!/src/util.ts
|
||||
|
||||
# Comment the following line if you want to rebuild the healthcheck binary
|
||||
/extra/healthcheck-armv7
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ RUN curl -fsSL https://letsencrypt.org/certs/gen-y/root-ye.pem -o /usr/local/sha
|
||||
|
||||
# Full Base Image
|
||||
# MariaDB, Chromium and fonts
|
||||
# Chromium runs headless, so the GPU stack is unused: ~57 MB smaller compressed.
|
||||
# Make sure to reuse the slim image here. Uncomment the above line if you want to build it from scratch.
|
||||
FROM louislam/uptime-kuma:base3-slim AS base3
|
||||
ENV UPTIME_KUMA_ENABLE_EMBEDDED_MARIADB=1
|
||||
@@ -68,4 +69,10 @@ RUN apt update && \
|
||||
apt --yes --no-install-recommends install chromium fonts-indic fonts-noto fonts-noto-cjk mariadb-server && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
apt --yes autoremove && \
|
||||
# Unused by headless Chromium (~190 MB on disk)
|
||||
rm -rf /usr/lib/x86_64-linux-gnu/libLLVM* \
|
||||
/usr/lib/x86_64-linux-gnu/libgallium* \
|
||||
/usr/lib/x86_64-linux-gnu/libz3* && \
|
||||
# Unused: embedded MariaDB uses /app/data/mariadb
|
||||
rm -rf /var/lib/mysql/* && \
|
||||
chown -R node:node /var/lib/mysql
|
||||
+1
-1
@@ -555,7 +555,7 @@ class Database {
|
||||
*/
|
||||
static createAuthDatabase(dbConfig) {
|
||||
let database;
|
||||
if (dbConfig.type.includes("mariadb")) {
|
||||
if (dbConfig.type === "mariadb") {
|
||||
database = mysql.createPool({
|
||||
host: dbConfig.hostname,
|
||||
port: Number(dbConfig.port),
|
||||
|
||||
@@ -262,7 +262,7 @@ class RealBrowserMonitorType extends MonitorType {
|
||||
}
|
||||
|
||||
const res = await page.goto(monitor.url, {
|
||||
waitUntil: "networkidle",
|
||||
waitUntil: "domcontentloaded",
|
||||
timeout: monitor.interval * 1000 * 0.8,
|
||||
});
|
||||
|
||||
|
||||
@@ -62,6 +62,10 @@ export default {
|
||||
* @returns {void}
|
||||
*/
|
||||
markDashboardLoading() {
|
||||
// Logged-out sessions show the login page; the bar has nothing to wait for
|
||||
if (this.$root.loginRequired) {
|
||||
return;
|
||||
}
|
||||
const current = this.$root.dashboardLoadProgress || 0;
|
||||
const next = this.progressController.routeProgress(this.$route.path, current);
|
||||
if (next !== this.$root.dashboardLoadProgress) {
|
||||
|
||||
@@ -39,6 +39,7 @@ export default {
|
||||
remember: localStorage.remember !== "0",
|
||||
allowLoginDialog: false, // Allowed to show login dialog, but "loggedIn" have to be true too. This exists because prevent the login dialog show 0.1s in first before the socket server auth-ed.
|
||||
loggedIn: false,
|
||||
loginRequired: false,
|
||||
monitorList: {},
|
||||
monitorTypeList: {},
|
||||
maintenanceList: {},
|
||||
@@ -168,6 +169,7 @@ export default {
|
||||
|
||||
socket.on("session", (username) => {
|
||||
this.loggedIn = true;
|
||||
this.$root.loginRequired = false;
|
||||
this.username = username;
|
||||
if (!this.$root.dashboardLoadProgress) {
|
||||
this.$root.dashboardLoadProgress = 8;
|
||||
@@ -176,6 +178,7 @@ export default {
|
||||
|
||||
socket.on("loginRequired", () => {
|
||||
this.allowLoginDialog = true;
|
||||
this.$root.loginRequired = true;
|
||||
this.$root.dashboardLoadProgress = 0;
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user