Skip to content

Commit

Permalink
Merge branch 'pazaan/fix-docker-image-build' of git://github.com/paza…
Browse files Browse the repository at this point in the history
…an/cgm-remote-monitor into dev
  • Loading branch information
bewest committed Dec 6, 2021
2 parents bf3d90d + 5e0e592 commit cc392c8
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,22 @@ FROM node:14.15.3-alpine

LABEL maintainer="Nightscout Contributors"

RUN mkdir -p /opt/app
ADD . /opt/app
WORKDIR /opt/app
RUN chown -R node:node /opt/app
USER node
ADD . /opt/app

RUN npm install && \
# TODO: We should be able to do `RUN npm install --only=production`.
# For this to work, we need to copy only package.json and things needed for `npm`'s to succeed.
# TODO: Do we need to re-add `npm audit fix`? Or should that be part of a development process/stage?
RUN npm install --cache /tmp/empty-cache && \
npm run postinstall && \
npm run env && \
npm audit fix
rm -rf /tmp/*
# TODO: These should be added in the future to correctly cache express-minify content to disk
# Currently, doing this breaks the browser cache.
# mkdir /tmp/public && \
# chown node:node /tmp/public

USER node
EXPOSE 1337

CMD ["node", "lib/server/server.js"]

0 comments on commit cc392c8

Please sign in to comment.