* docker: initial config

* docker: add entrypoint for headless run

* docker: resolve path from env variable

* docker: initial config

* docker: rename preloaded data directories

* docker: update README

* docker: prevent issue with port mappings

* docker: update README.md

* docker: add docker-compose

* docker: cleanup logs

* docker: add CI

* docker: cleanup unused

* docker: use static port in development

* refactor: isolate tasks

* docker: add demo db

* fix: download db resolves according to OS

* docker: config build

* fix: ensure db path exists

* fix: add object type to block

* docker: config build

* docker: config build

* docker: env is production

* docker: preload db

* fix: remove test dir

* docker: graceful shutdown node app

* docker: env is production

* docker: add docker-compose

* docker: remove unused mappings

* docker: version bump
This commit is contained in:
Carlos Valente
2022-06-08 21:57:22 +02:00
committed by GitHub
parent 94a7ef6318
commit 9c5c7ee69a
23 changed files with 214 additions and 187 deletions
+5 -9
View File
@@ -15,20 +15,16 @@ export function ensureDirectory(directory) {
}
}
/**
* @description Whether a file exists
* @param directory
* @return {boolean}
*/
export function doesFileExist(directory) {
return existsSync(directory);
}
/**
* @description Returns public path depending on OS
* @return {string|*}
*/
export function getAppDataPath() {
// handle docker
if (process.env.ONTIME_DATA) {
return path.join(process.env.ONTIME_DATA);
}
switch (process.platform) {
case 'darwin': {
return path.join(process.env.HOME, 'Library', 'Application Support', 'Ontime');