mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 13:39:01 +01: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.
 | 
			
		||||
RUN ls
 | 
			
		||||
RUN cp -R build/src/* src/.
 | 
			
		||||
 | 
			
		||||
# Copy the healthcheck
 | 
			
		||||
RUN cp build/docker_healthcheck.js .
 | 
			
		||||
RUN rm docker_healthcheck.ts
 | 
			
		||||
 | 
			
		||||
RUN rm -r build
 | 
			
		||||
 | 
			
		||||
# Install app dependencies
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
const http = require("http");
 | 
			
		||||
const ini = require("ini");
 | 
			
		||||
const fs = require("fs");
 | 
			
		||||
const dataDir = require('./src/services/data_dir');
 | 
			
		||||
import http from "http";
 | 
			
		||||
import ini from "ini";
 | 
			
		||||
import fs from "fs";
 | 
			
		||||
import dataDir from './src/services/data_dir.js';
 | 
			
		||||
const config = ini.parse(fs.readFileSync(dataDir.CONFIG_INI_PATH, 'utf-8'));
 | 
			
		||||
 | 
			
		||||
if (config.Network.https) {
 | 
			
		||||
@ -10,12 +10,12 @@ if (config.Network.https) {
 | 
			
		||||
    process.exit(0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const port = require('./src/services/port');
 | 
			
		||||
const host = require('./src/services/host');
 | 
			
		||||
import port from './src/services/port.js';
 | 
			
		||||
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}`);
 | 
			
		||||
    if (res.statusCode === 200) {
 | 
			
		||||
        process.exit(0);
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user