diff --git a/Dockerfile b/Dockerfile index 082f221a..bd521474 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,14 @@ -FROM node:lts-alpine3.12 AS build +FROM node:lts-alpine AS build RUN apk add --no-cache make gcc g++ python3 linux-headers udev tzdata WORKDIR /app COPY package*.json ./ +COPY defaultConfig.json config.json RUN npm ci COPY . . RUN npm run build -RUN npm ci --production +RUN npm ci --omit=dev -FROM node:lts-alpine3.12 as prod +FROM node:lts-alpine as prod RUN apk add git RUN mkdir /app && chown node:node /app WORKDIR /app diff --git a/config/Config.ts b/config/Config.ts index 041ca924..af2543ba 100755 --- a/config/Config.ts +++ b/config/Config.ts @@ -36,7 +36,7 @@ class Config { // RKS 05-18-20: This originally had multiple points of failure where it was not in the try/catch. try { this._isLoading = true; - this._cfg = fs.existsSync(this.cfgPath) ? JSON.parse(fs.readFileSync(this.cfgPath, "utf8")) : {}; + this._cfg = fs.existsSync(this.cfgPath) ? JSON.parse(fs.readFileSync(this.cfgPath, "utf8").trim()) : {}; const def = JSON.parse(fs.readFileSync(path.join(process.cwd(), "/defaultConfig.json"), "utf8").trim()); const packageJson = JSON.parse(fs.readFileSync(path.join(process.cwd(), "/package.json"), "utf8").trim()); this._cfg = extend(true, {}, def, this._cfg, { appVersion: packageJson.version });