From 013c13c6766a2020887d56d1dab3190ccc958b11 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Mon, 23 Jun 2025 09:46:17 +0200 Subject: [PATCH] fix(docker): clean up dockerfiles (#60947) --- docker/api/Dockerfile | 4 ++-- docker/web/Dockerfile | 19 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/docker/api/Dockerfile b/docker/api/Dockerfile index 8f7abaa86cf..3814c970079 100644 --- a/docker/api/Dockerfile +++ b/docker/api/Dockerfile @@ -2,7 +2,7 @@ FROM node:22-bookworm AS builder RUN apt-get update && apt-get install -y jq # global installs need root permissions, so have to happen before we switch to # the node user -RUN npm i -g pnpm@10 +RUN corepack enable # node images create a non-root user that we can use USER node WORKDIR /home/node/build @@ -41,7 +41,7 @@ COPY --chown=node:node pnpm*.yaml . COPY --chown=node:node package.json . COPY --chown=node:node api/ api/ COPY --chown=node:node shared/ shared/ -RUN npm i -g pnpm@10 +RUN corepack enable # Weirdly this config does not seem necessary for the new api (the same number # of deps are installed in both cases), but I'm including it just for diff --git a/docker/web/Dockerfile b/docker/web/Dockerfile index e2dfa794df7..2edbed2bebc 100644 --- a/docker/web/Dockerfile +++ b/docker/web/Dockerfile @@ -1,7 +1,7 @@ FROM node:22-bookworm AS builder # global installs need root permissions, so have to happen before we switch to # the node user -RUN npm i -g pnpm@10 +RUN corepack enable # node images create a non-root user that we can use USER node WORKDIR /home/node/build @@ -13,21 +13,20 @@ COPY --chown=node:node tools/ tools/ COPY --chown=node:node curriculum/ curriculum/ ARG HOME_LOCATION -ARG API_LOCATION -ARG FORUM_LOCATION ARG NEWS_LOCATION -ARG RADIO_LOCATION ARG CLIENT_LOCALE ARG CURRICULUM_LOCALE -ARG ALGOLIA_APP_ID +ARG API_LOCATION ARG ALGOLIA_API_KEY -ARG STRIPE_PUBLIC_KEY -ARG PAYPAL_CLIENT_ID -ARG PATREON_CLIENT_ID -ARG DEPLOYMENT_ENV -ARG SHOW_UPCOMING_CHANGES +ARG ALGOLIA_APP_ID ARG GROWTHBOOK_URI +ARG FORUM_LOCATION +ARG PATREON_CLIENT_ID +ARG PAYPAL_CLIENT_ID +ARG STRIPE_PUBLIC_KEY +ARG SHOW_UPCOMING_CHANGES ARG FREECODECAMP_NODE_ENV +ARG DEPLOYMENT_ENV # For simplicity and because node_modules do not make it into the final image, # we can just install all dependencies here.