mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
docker: Fix healthcheck & convert to TypeScript (closes #296)
This commit is contained in:
parent
9cf14cc3a8
commit
f4e7dcd5e8
@ -24,6 +24,11 @@ COPY server-package.json package.json
|
|||||||
# Copy TypeScript build artifacts into the original directory structure.
|
# Copy TypeScript build artifacts into the original directory structure.
|
||||||
RUN ls
|
RUN ls
|
||||||
RUN cp -R build/src/* src/.
|
RUN cp -R build/src/* src/.
|
||||||
|
|
||||||
|
# Copy the healthcheck
|
||||||
|
RUN cp build/docker_healthcheck.js .
|
||||||
|
RUN rm docker_healthcheck.ts
|
||||||
|
|
||||||
RUN rm -r build
|
RUN rm -r build
|
||||||
|
|
||||||
# Install app dependencies
|
# Install app dependencies
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
const http = require("http");
|
import http from "http";
|
||||||
const ini = require("ini");
|
import ini from "ini";
|
||||||
const fs = require("fs");
|
import fs from "fs";
|
||||||
const dataDir = require('./src/services/data_dir');
|
import dataDir from './src/services/data_dir.js';
|
||||||
const config = ini.parse(fs.readFileSync(dataDir.CONFIG_INI_PATH, 'utf-8'));
|
const config = ini.parse(fs.readFileSync(dataDir.CONFIG_INI_PATH, 'utf-8'));
|
||||||
|
|
||||||
if (config.Network.https) {
|
if (config.Network.https) {
|
||||||
@ -10,12 +10,12 @@ if (config.Network.https) {
|
|||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
const port = require('./src/services/port');
|
import port from './src/services/port.js';
|
||||||
const host = require('./src/services/host');
|
import host from './src/services/host.js';
|
||||||
|
|
||||||
const options = { timeout: 2000 };
|
const options: http.RequestOptions = { timeout: 2000 };
|
||||||
|
|
||||||
const callback = res => {
|
const callback: (res: http.IncomingMessage) => void = res => {
|
||||||
console.log(`STATUS: ${res.statusCode}`);
|
console.log(`STATUS: ${res.statusCode}`);
|
||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
process.exit(0);
|
process.exit(0);
|
Loading…
x
Reference in New Issue
Block a user