@@ -21,6 +21,9 @@ ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-$
2121ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}"
2222ARG NODE_IMAGE="node:${NODE_VERSION}"
2323
24+ FROM ${NODE_IMAGE} as node
25+
26+ RUN PUPPETEER_CACHE_DIR=/app/puppeteer npx --yes puppeteer browsers install
2427
2528FROM ${BUILDER_IMAGE} as builder
2629
@@ -55,7 +58,7 @@ COPY lib lib
5558
5659COPY assets assets
5760
58- COPY --from=node:23-bookworm-slim /usr/local/bin /usr/local/bin
61+ COPY --from=node /usr/local/bin /usr/local/bin
5962
6063# compile assets
6164RUN mix assets.deploy
@@ -69,10 +72,6 @@ COPY config/runtime.exs config/
6972COPY rel rel
7073RUN mix release
7174
72- FROM ${NODE_IMAGE} as node
73-
74- RUN PUPPETEER_CACHE_DIR=/app/puppeteer npx --yes puppeteer browsers install
75-
7675# start a new build stage so that the final image will only contain
7776# the compiled release and other runtime necessities
7877FROM ${RUNNER_IMAGE}
@@ -84,7 +83,7 @@ RUN apt-get update -y && \
8483# TODO: remove after migration
8584RUN apt-get update -y && apt-get install -y postgresql-client
8685
87- COPY --from=node:23-bookworm-slim /usr/local/bin /usr/local/bin
86+ COPY --from=node /usr/local/bin /usr/local/bin
8887
8988RUN apt-get update -y && apt-get install -y ca-certificates fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils
9089
@@ -104,7 +103,7 @@ ENV MIX_ENV="prod"
104103# Copy the final release from the build stage
105104COPY --from=builder --chown=nobody:root /app/_build/${MIX_ENV}/rel/algora ./
106105
107- # Copy the puppeteer cache from the build stage
106+ # Copy the puppeteer cache from the node stage
108107COPY --from=node --chown=nobody:root /app/puppeteer ./puppeteer
109108
110109USER nobody
0 commit comments