Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REFACTOR] [CONFIG] Dockerfile optimizations #473

Merged
merged 1 commit into from
Sep 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
###############################################################################
FROM node:22.8.0-alpine3.20 AS base

RUN apk add --update --no-cache make
RUN apk upgrade --update --no-cache openssl libcrypto3 libssl3 # FIX CVE-2024-5535
RUN apk add --update --no-cache make \
&& apk upgrade --update --no-cache openssl libcrypto3 libssl3 # FIX CVE-2024-5535

ENV WORKDIR=/app
WORKDIR ${WORKDIR}
Expand All @@ -13,10 +13,9 @@ FROM base AS lint
ENV WORKDIR=/app
WORKDIR ${WORKDIR}

RUN apk add --update --no-cache make nodejs npm
RUN apk add --update --no-cache yamllint

RUN npm install -g --ignore-scripts markdownlint-cli
RUN apk add --update --no-cache make nodejs npm \
&& apk add --update --no-cache yamllint \
&& npm install -g --ignore-scripts markdownlint-cli

# [!TIP] Use a bind-mount to "/app" to override following "copys"
# for lint and test against "current" sources in this stage
Expand Down Expand Up @@ -124,8 +123,8 @@ COPY ./Makefile ${WORKDIR}/
COPY ./package.json ${WORKDIR}/package.json
COPY ./package-lock.json ${WORKDIR}/package-lock.json

RUN npm ci --verbose --omit=dev --omit=optional --ignore-scripts --no-cache
RUN ls -alh
RUN npm ci --verbose --omit=dev --omit=optional --ignore-scripts --no-cache \
&& ls -alh

USER node
CMD ["ls", "-alh"]