Skip to content

Commit 420a7cc

Browse files
author
Gonzalo Diaz
committed
[REFACTOR] [CONFIG] Dockerfile optimizations
1 parent 566c448 commit 420a7cc

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Dockerfile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
###############################################################################
22
FROM node:22.8.0-alpine3.20 AS base
33

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

77
ENV WORKDIR=/app
88
WORKDIR ${WORKDIR}
@@ -13,10 +13,9 @@ FROM base AS lint
1313
ENV WORKDIR=/app
1414
WORKDIR ${WORKDIR}
1515

16-
RUN apk add --update --no-cache make nodejs npm
17-
RUN apk add --update --no-cache yamllint
18-
19-
RUN npm install -g --ignore-scripts markdownlint-cli
16+
RUN apk add --update --no-cache make nodejs npm \
17+
&& apk add --update --no-cache yamllint \
18+
&& npm install -g --ignore-scripts markdownlint-cli
2019

2120
# [!TIP] Use a bind-mount to "/app" to override following "copys"
2221
# for lint and test against "current" sources in this stage
@@ -121,8 +120,8 @@ COPY ./Makefile ${WORKDIR}/
121120
COPY ./package.json ${WORKDIR}/package.json
122121
COPY ./package-lock.json ${WORKDIR}/package-lock.json
123122

124-
RUN npm ci --verbose --omit=dev --omit=optional --ignore-scripts --no-cache
125-
RUN ls -alh
123+
RUN npm ci --verbose --omit=dev --omit=optional --ignore-scripts --no-cache \
124+
&& ls -alh
126125

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

0 commit comments

Comments
 (0)