Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(platform): ship Node 24.22.1 in the Docker images, refusing the compromised eMudhra CAs (#15888)

Reinier van der Leerfabb34d832af
diff --git a/autogpt_platform/backend/Dockerfile b/autogpt_platform/backend/Dockerfile
index a7984eb486..fa3f0af49a 100644
--- a/autogpt_platform/backend/Dockerfile
+++ b/autogpt_platform/backend/Dockerfile
@@ -1,3 +1,7 @@
+# Node.js for Prisma and agent-browser comes from the official image, which
+# gets Node's security releases before the NodeSource apt repository does.
+FROM node:24.22.1-trixie-slim AS node
+
# ============================ DEPENDENCY BUILDER ============================ #
FROM debian:13-slim AS builder
@@ -18,16 +22,10 @@ RUN echo 'Acquire::http::Pipeline-Depth 0;\nAcquire::http::No-Cache true;\nAcqui
# before its first install.
ARG APT_REFRESH
-# Install Node.js repository key and setup
+# Install Python and build dependencies
RUN apt-get update --allow-releaseinfo-change --fix-missing \
- && apt-get install -y curl ca-certificates gnupg \
- && mkdir -p /etc/apt/keyrings \
- && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
- && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
-
-# Update package list and install Python, Node.js, and build dependencies
-RUN apt-get update \
&& apt-get install -y \
+ ca-certificates \
python3.13 \
python3.13-dev \
python3.13-venv \
@@ -38,9 +36,13 @@ RUN apt-get update \
libz-dev \
libssl-dev \
postgresql-client \
- nodejs \
&& rm -rf /var/lib/apt/lists/*
+COPY --from=node /usr/local/bin/node /usr/bin/node
+COPY --from=node /usr/local/lib/node_modules/npm /usr/lib/node_modules/npm
+RUN ln -s ../lib/node_modules/npm/bin/npm-cli.js /usr/bin/npm \
+ && ln -s ../lib/node_modules/npm/bin/npx-cli.js /usr/bin/npx
+
ENV POETRY_HOME=/opt/poetry
ENV POETRY_NO_INTERACTION=1
ENV POETRY_VIRTUALENVS_CREATE=true
diff --git a/autogpt_platform/frontend/Dockerfile b/autogpt_platform/frontend/Dockerfile
index a16e9c96e5..5fd70c6ba7 100644
--- a/autogpt_platform/frontend/Dockerfile
+++ b/autogpt_platform/frontend/Dockerfile
@@ -1,5 +1,5 @@
# Base stage for both dev and prod
-FROM node:24.21-alpine3.23 AS base
+FROM node:24.22.1-alpine3.23 AS base
WORKDIR /app
RUN corepack enable
COPY autogpt_platform/frontend/package.json autogpt_platform/frontend/pnpm-lock.yaml ./
@@ -38,7 +38,7 @@ RUN pnpm run generate:api
RUN --mount=type=cache,target=/app/.next/cache,id=next-build-cache if [ "$NEXT_PUBLIC_PW_TEST" = "true" ]; then NEXT_PUBLIC_PW_TEST=true NODE_OPTIONS="--max-old-space-size=8192" pnpm build; else NODE_OPTIONS="--max-old-space-size=8192" pnpm build; fi
# Prod stage - based on NextJS reference Dockerfile https://github.com/vercel/next.js/blob/64271354533ed16da51be5dce85f0dbd15f17517/examples/with-docker/Dockerfile
-FROM node:24.21-alpine3.23 AS prod
+FROM node:24.22.1-alpine3.23 AS prod
ENV NODE_ENV=production
ENV HOSTNAME=0.0.0.0
WORKDIR /app
diff --git a/autogpt_platform/single-container/Dockerfile b/autogpt_platform/single-container/Dockerfile
index febe3da967..10ab8e11cd 100644
--- a/autogpt_platform/single-container/Dockerfile
+++ b/autogpt_platform/single-container/Dockerfile
@@ -4,7 +4,7 @@
# be copied into the Debian appliance image. Browser-facing service URLs are
# intentionally same-origin paths; the in-container reverse proxy decides
# where they land at runtime.
-FROM node:24.21.0-bookworm-slim@sha256:d6aa754f16b3197301076f047b5def2f02ea1dbbc2ca920407d46d7ec7f87b20 AS frontend
+FROM node:24.22.1-bookworm-slim@sha256:1681862882da07ee5476fee047bcf34138833f1df42633bb25bcb0f438d5bf3d AS frontend
WORKDIR /app
RUN corepack enable
@@ -33,7 +33,7 @@ RUN pnpm run generate:api \
&& NODE_OPTIONS="--max-old-space-size=8192" pnpm build \
&& rm -f .env .env.local .env.production
-FROM node:24.21.0-bookworm-slim@sha256:d6aa754f16b3197301076f047b5def2f02ea1dbbc2ca920407d46d7ec7f87b20 AS node-runtime
+FROM node:24.22.1-bookworm-slim@sha256:1681862882da07ee5476fee047bcf34138833f1df42633bb25bcb0f438d5bf3d AS node-runtime
ARG NPM_VERSION=12.0.2
RUN npm install --global "npm@${NPM_VERSION}" \