diff --git a/Dockerfile b/Dockerfile index cfa0c30a..073b26f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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} @@ -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 @@ -121,8 +120,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"] diff --git a/Makefile b/Makefile index 5e6ca78e..ccae53a8 100644 --- a/Makefile +++ b/Makefile @@ -97,35 +97,35 @@ update: dependencies outdated upgrade: update compose/build: env - docker-compose --profile lint build - docker-compose --profile testing build - docker-compose --profile production build + ${DOCKER_COMPOSE} --profile lint build + ${DOCKER_COMPOSE} --profile testing build + ${DOCKER_COMPOSE} --profile production build compose/rebuild: env - docker-compose --profile lint build --no-cache - docker-compose --profile testing build --no-cache - docker-compose --profile production build --no-cache + ${DOCKER_COMPOSE} --profile lint build --no-cache + ${DOCKER_COMPOSE} --profile testing build --no-cache + ${DOCKER_COMPOSE} --profile production build --no-cache compose/lint/markdown: compose/build - docker-compose --profile lint build - docker-compose --profile lint run --rm algorithm-exercises-js-lint make lint/markdown + ${DOCKER_COMPOSE} --profile lint build + ${DOCKER_COMPOSE} --profile lint run --rm algorithm-exercises-js-lint make lint/markdown compose/lint/yaml: compose/build - docker-compose --profile lint run --rm algorithm-exercises-js-lint make lint/yaml + ${DOCKER_COMPOSE} --profile lint run --rm algorithm-exercises-js-lint make lint/yaml compose/test/styling: compose/build - docker-compose --profile lint run --rm algorithm-exercises-js-lint make test/styling + ${DOCKER_COMPOSE} --profile lint run --rm algorithm-exercises-js-lint make test/styling compose/test/static: compose/build - docker-compose --profile lint run --rm algorithm-exercises-js-lint make test/static + ${DOCKER_COMPOSE} --profile lint run --rm algorithm-exercises-js-lint make test/static compose/lint: compose/lint/markdown compose/lint/yaml compose/test/styling compose/test/static compose/test: compose/build - docker-compose --profile testing run --rm algorithm-exercises-js-test make test + ${DOCKER_COMPOSE} --profile testing run --rm algorithm-exercises-js-test make test compose/run: compose/build - docker-compose --profile production run --rm algorithm-exercises-js make run + ${DOCKER_COMPOSE} --profile production run --rm algorithm-exercises-js make run all: env dependencies test