Skip to content

Commit 0e5c3fb

Browse files
authored
feature/846-async-logging (#84)
* Update docker config to handle logfile output * Fix npm audit failure
1 parent d02ca53 commit 0e5c3fb

3 files changed

Lines changed: 1565 additions & 57 deletions

File tree

‎Dockerfile‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:10.15.3-alpine
1+
FROM node:10.15.3-alpine as builder
22
USER root
33

44
WORKDIR /opt/email-notifier
@@ -10,15 +10,23 @@ RUN apk add --no-cache -t build-dependencies make gcc g++ python libtool autocon
1010
&& npm install -g node-gyp
1111

1212
COPY package.json package-lock.json* /opt/email-notifier/
13-
RUN npm install --production && \
14-
npm uninstall -g npm
15-
16-
RUN apk del build-dependencies
13+
RUN npm install
1714

1815
COPY src /opt/email-notifier/src
1916
COPY config /opt/email-notifier/config
2017
COPY app.js /opt/email-notifier/
2118
COPY templates /opt/email-notifier/templates
2219

20+
FROM node:10.15.3-alpine
21+
22+
WORKDIR /opt/email-notifier
23+
24+
COPY --from=builder /opt/email-notifier .
25+
RUN npm prune --production
26+
27+
# Create empty log file & link stdout to the application log file
28+
RUN mkdir ./logs && touch ./logs/combined.log
29+
RUN ln -sf /dev/stdout ./logs/combined.log
30+
2331
EXPOSE 3081
2432
CMD node app.js

0 commit comments

Comments
 (0)