Created
October 2, 2023 19:58
-
-
Save Rud5G/f65c2d518adaafc0bb2db6b328d166f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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