Files
cgm-remote-monitor/Dockerfile
T
Ben West ecafd4782c Fix Docker/Heroku builds with --omit=optional
Use npm ci with --omit=optional to skip optional dependencies like
fsevents (darwin-only) that were causing build failures on Linux
platforms including Heroku and local Docker builds on Mac.
2026-03-01 12:25:55 -08:00

24 lines
751 B
Docker

FROM node:22-alpine
LABEL maintainer="Nightscout Contributors"
WORKDIR /opt/app
ADD . /opt/app
# 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 ci --cache /tmp/empty-cache --omit=optional && \
npm run postinstall && \
npm run env && \
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"]