chore(docker): reintroduce healthchecks

This commit is contained in:
Elian Doran 2025-04-30 10:23:13 +03:00
parent 78c88d797c
commit 614958f16c
No known key found for this signature in database
4 changed files with 8 additions and 5 deletions

View File

@ -24,4 +24,4 @@ FROM node:22.14.0-bullseye-slim
# Configure container
EXPOSE 8080
CMD [ "sh", "./start-docker.sh" ]
HEALTHCHECK --start-period=10s CMD exec gosu node node docker_healthcheck.js
HEALTHCHECK --start-period=10s CMD exec gosu node node /usr/src/app/docker_healthcheck.js

View File

@ -22,4 +22,4 @@ FROM node:22.14.0-alpine
# Configure container
EXPOSE 8080
CMD [ "sh", "./start-docker.sh" ]
HEALTHCHECK --start-period=10s CMD exec su-exec node node docker_healthcheck.js
HEALTHCHECK --start-period=10s CMD exec su-exec node node /usr/src/app/docker_healthcheck.js

View File

@ -1,5 +1,5 @@
import http from "http";
import config from "./src/services/config.js";
import config from "./services/config.js";
if (config.Network.https) {
// built-in TLS (terminated by trilium) is not supported yet, PRs are welcome
@ -7,8 +7,8 @@ if (config.Network.https) {
process.exit(0);
}
import port from "./src/services/port.js";
import host from "./src/services/host.js";
import port from "./services/port.js";
import host from "./services/host.js";
const options: http.RequestOptions = { timeout: 2000 };

View File

@ -58,6 +58,9 @@ module.exports = {
optimization: false,
outputHashing: 'none',
generatePackageJson: true,
additionalEntryPoints: [
"./src/docker_healthcheck.ts"
],
externalDependencies: [
"electron/main",
"@electron/remote/main",