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/2123872d2445331111a30665922c00de to your computer and use it in GitHub Desktop.
Save osher/2123872d2445331111a30665922c00de to your computer and use it in GitHub Desktop.
FROM node:alpine-lts
WORKDIR /app
COPY packge.json .
RUN npm i --production
FROM alpine
RUN apk update \
&& apk upgrade --no-cache \
&& apk add --no-cache nodejs \
&& rm -r /**/apk /**/**/apk
WORKDIR /app
COPY --from=0 /app /
COPY . /app/
RUN addgroup -S service \
&& adduser -S service -G service
USER service
EXPOSE 3000/tcp
ENTRYPOINT ["node", "index.js"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment