2022-06-06 16:27:27 +00:00
|
|
|
### STAGE 1: Build ###
|
|
|
|
FROM quay.io/sartography/node:latest
|
2022-11-09 03:36:39 +00:00
|
|
|
|
2022-06-06 16:27:27 +00:00
|
|
|
RUN mkdir /app
|
|
|
|
WORKDIR /app
|
2022-10-06 19:31:23 +00:00
|
|
|
|
2022-11-04 23:03:53 +00:00
|
|
|
# this matches total memory on spiffworkflow-demo
|
|
|
|
ENV NODE_OPTIONS=--max_old_space_size=2048
|
|
|
|
|
2022-11-09 03:36:39 +00:00
|
|
|
ADD package.json /app/
|
|
|
|
ADD package-lock.json /app/
|
|
|
|
|
2022-10-06 19:31:23 +00:00
|
|
|
# npm ci because it respects the lock file.
|
|
|
|
# --ignore-scripts because authors can do bad things in postinstall scripts.
|
|
|
|
# https://cheatsheetseries.owasp.org/cheatsheets/NPM_Security_Cheat_Sheet.html
|
|
|
|
# npx can-i-ignore-scripts can check that it's safe to ignore scripts.
|
2022-11-04 23:04:59 +00:00
|
|
|
RUN npm ci --ignore-scripts
|
2022-11-09 03:36:39 +00:00
|
|
|
|
|
|
|
COPY . /app/
|
|
|
|
|
2022-11-04 23:04:59 +00:00
|
|
|
RUN npm run build
|
2022-06-06 16:27:27 +00:00
|
|
|
|
|
|
|
ENTRYPOINT ["/app/bin/boot_server_in_docker"]
|