Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit f4e7dcd

Browse files
committed
docker: Fix healthcheck & convert to TypeScript (closes #296)
1 parent 9cf14cc commit f4e7dcd

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ COPY server-package.json package.json
2424
# Copy TypeScript build artifacts into the original directory structure.
2525
RUN ls
2626
RUN cp -R build/src/* src/.
27+
28+
# Copy the healthcheck
29+
RUN cp build/docker_healthcheck.js .
30+
RUN rm docker_healthcheck.ts
31+
2732
RUN rm -r build
2833

2934
# Install app dependencies

docker_healthcheck.js renamed to docker_healthcheck.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const http = require("http");
2-
const ini = require("ini");
3-
const fs = require("fs");
4-
const dataDir = require('./src/services/data_dir');
1+
import http from "http";
2+
import ini from "ini";
3+
import fs from "fs";
4+
import dataDir from './src/services/data_dir.js';
55
const config = ini.parse(fs.readFileSync(dataDir.CONFIG_INI_PATH, 'utf-8'));
66

77
if (config.Network.https) {
@@ -10,12 +10,12 @@ if (config.Network.https) {
1010
process.exit(0);
1111
}
1212

13-
const port = require('./src/services/port');
14-
const host = require('./src/services/host');
13+
import port from './src/services/port.js';
14+
import host from './src/services/host.js';
1515

16-
const options = { timeout: 2000 };
16+
const options: http.RequestOptions = { timeout: 2000 };
1717

18-
const callback = res => {
18+
const callback: (res: http.IncomingMessage) => void = res => {
1919
console.log(`STATUS: ${res.statusCode}`);
2020
if (res.statusCode === 200) {
2121
process.exit(0);

0 commit comments

Comments
 (0)