Skip to content

Instantly share code, notes, and snippets.

@osher
Last active August 8, 2023 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save osher/68e289b3102d15f05c79b125252970fa to your computer and use it in GitHub Desktop.
Save osher/68e289b3102d15f05c79b125252970fa to your computer and use it in GitHub Desktop.
Example for the Dockerfile for node-services using an multi-phase build with optimized node-builder and node-runner.
ARG TAG_NODE_BUILDER=latest
FROM my-private-cr/node-builder:$TAG_NODE_BUILDER
COPY packge.json .
RUN npm i --production
ARG TAG_NODE_RUNNER=latest
FROM my-private-cr/node-runner:$TAG_NODE_RUNNER
COPY --from=0 /app /
COPY . /app/
RUN apk update --no-cache
&& apk upgrade --no-cache
&& rm -r /**/apk /**/**/apk
USER service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment