Skip to content

Commit

Permalink
Merge pull request #770 from emes/docker-updates
Browse files Browse the repository at this point in the history
add trim for config, update dockerfile
  • Loading branch information
tagyoureit authored May 31, 2023
2 parents 9eb0f5d + cffeb77 commit 64743d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion config/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down

0 comments on commit 64743d6

Please sign in to comment.