Skip to content

Instantly share code, notes, and snippets.

@Rud5G
Created October 2, 2023 19:58
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 Rud5G/f65c2d518adaafc0bb2db6b328d166f3 to your computer and use it in GitHub Desktop.
Save Rud5G/f65c2d518adaafc0bb2db6b328d166f3 to your computer and use it in GitHub Desktop.
FROM public.ecr.aws/amazonlinux/amazonlinux:2023
# We tell DNF not to install Recommends and Suggests packages, which are
# weak dependencies in DNF terminology, thus keeping our installed set of
# packages as minimal as possible.
RUN dnf --setopt=install_weak_deps=False install -q -y \
nodejs \
npm \
shadow-utils \
&& \
dnf clean all
ENV APPUSER=appuser
ENV APPUID=1000
ENV APPGID=1000
RUN useradd \
--home "/app" \
--create-home \
--user-group \
--uid "$APPUID" \
"$APPUSER"
WORKDIR /app
USER appuser
COPY --chown=appuser:appuser package.json .
COPY --chown=appuser:appuser package-lock.json .
RUN npm ci
ADD . /app
RUN npm run build
ENTRYPOINT [ "node", "dist/main.js" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment