From 1e6b1b9554601179e612123435c9ae394367d5ce Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Fri, 11 Apr 2025 00:42:32 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=B3=20feat:=20Add=20Jemalloc=20and=20U?= =?UTF-8?q?V=20to=20Docker=20Builds=20(#6836)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add `uv` for extended MCP support in Dockerfiles * feat: Install jemalloc and set environment variable to use it --- Dockerfile | 12 ++++++++++-- Dockerfile.multi | 7 +++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d9113eb650..e16b18a5d4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,15 @@ # Base node image FROM node:20-alpine AS node -RUN apk --no-cache add curl +# Install jemalloc +RUN apk add --no-cache jemalloc + +# Set environment variable to use jemalloc +ENV LD_PRELOAD=/usr/lib/libjemalloc.so.2 + +# Add `uv` for extended MCP support +COPY --from=ghcr.io/astral-sh/uv:0.6.13 /uv /uvx /bin/ +RUN uv --version RUN mkdir -p /app && chown node:node /app WORKDIR /app @@ -38,4 +46,4 @@ CMD ["npm", "run", "backend"] # WORKDIR /usr/share/nginx/html # COPY --from=node /app/client/dist /usr/share/nginx/html # COPY client/nginx.conf /etc/nginx/conf.d/default.conf -# ENTRYPOINT ["nginx", "-g", "daemon off;"] +# ENTRYPOINT ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/Dockerfile.multi b/Dockerfile.multi index 40721137bb..594ead8b03 100644 --- a/Dockerfile.multi +++ b/Dockerfile.multi @@ -3,6 +3,10 @@ # Base for all builds FROM node:20-alpine AS base-min +# Install jemalloc +RUN apk add --no-cache jemalloc +# Set environment variable to use jemalloc +ENV LD_PRELOAD=/usr/lib/libjemalloc.so.2 WORKDIR /app RUN apk --no-cache add curl RUN npm config set fetch-retry-maxtimeout 600000 && \ @@ -50,6 +54,9 @@ RUN npm run build # API setup (including client dist) FROM base-min AS api-build +# Add `uv` for extended MCP support +COPY --from=ghcr.io/astral-sh/uv:0.6.13 /uv /uvx /bin/ +RUN uv --version WORKDIR /app # Install only production deps RUN npm ci --omit=dev