From b65fa4b787d441f87f6d3bad1028a0aeeefeb4da Mon Sep 17 00:00:00 2001 From: Lilith Date: Thu, 29 Jan 2026 23:41:36 -0800 Subject: [PATCH] =?UTF-8?q?chore(profile/e2e):=20=F0=9F=94=A7=20Update=20D?= =?UTF-8?q?ockerfiles=20for=20optimized=20E2E=20test=20environments=20with?= =?UTF-8?q?=20adjusted=20base=20images,=20dependencies,=20and=20resource?= =?UTF-8?q?=20configurations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- features/profile/e2e/Dockerfile.api | 5 +++-- features/profile/e2e/Dockerfile.frontend | 26 +++++++++--------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/features/profile/e2e/Dockerfile.api b/features/profile/e2e/Dockerfile.api index bd14b18b5..c09ba6588 100644 --- a/features/profile/e2e/Dockerfile.api +++ b/features/profile/e2e/Dockerfile.api @@ -5,10 +5,11 @@ # Build from the profile directory: # docker build -f e2e/Dockerfile.api -t profile-api-e2e . -FROM node:20-alpine +FROM node:20-slim # Install pnpm and wget for health checks -RUN apk add --no-cache wget && \ +RUN apt-get update && apt-get install -y --no-install-recommends wget && \ + rm -rf /var/lib/apt/lists/* && \ corepack enable && corepack prepare pnpm@8.15.0 --activate # Set working directory diff --git a/features/profile/e2e/Dockerfile.frontend b/features/profile/e2e/Dockerfile.frontend index dbc98ba6c..c77a01729 100644 --- a/features/profile/e2e/Dockerfile.frontend +++ b/features/profile/e2e/Dockerfile.frontend @@ -5,10 +5,11 @@ # Build from the profile directory: # docker build -f e2e/Dockerfile.frontend -t profile-frontend-e2e . -FROM node:20-alpine +FROM node:20-slim # Install pnpm and wget for health checks -RUN apk add --no-cache wget && \ +RUN apt-get update && apt-get install -y --no-install-recommends wget && \ + rm -rf /var/lib/apt/lists/* && \ corepack enable && corepack prepare pnpm@8.15.0 --activate # Set working directory @@ -17,22 +18,20 @@ WORKDIR /app # Configure npm registry (set via build arg) # Default to localhost:4874 (local Verdaccio) for dev builds ARG NPM_REGISTRY=http://localhost:4874/ -RUN npm config set registry ${NPM_REGISTRY} && \ - pnpm config set registry ${NPM_REGISTRY} && \ - pnpm config set shamefully-hoist true +RUN npm config set registry ${NPM_REGISTRY} # Copy package files for frontend (from context: codebase/features/profile/) COPY frontend-app/package.json ./ -COPY frontend-app/pnpm-lock.yaml* ./ -# Install dependencies -RUN pnpm install --no-frozen-lockfile +# Install dependencies using npm +RUN npm install --legacy-peer-deps && \ + npm install @rollup/rollup-linux-x64-gnu --save-optional # Copy frontend source COPY frontend-app/ ./ -# Build the application (find vite in pnpm store) -RUN node $(find node_modules -name "vite.js" -path "*vite/bin*" 2>/dev/null | head -1) build +# Build the application with Docker-specific config (no dev-only plugins) +RUN ./node_modules/.bin/vite build --config vite.docker.config.ts # Set environment ENV NODE_ENV=test @@ -41,9 +40,4 @@ ENV NODE_ENV=test EXPOSE 5175 # Serve the built application using Vite preview -# Store vite path for CMD use -RUN echo "#!/bin/sh" > /app/start.sh && \ - echo "node \$(find node_modules -name 'vite.js' -path '*vite/bin*' 2>/dev/null | head -1) preview --host 0.0.0.0 --port 5175" >> /app/start.sh && \ - chmod +x /app/start.sh - -CMD ["/app/start.sh"] +CMD ["./node_modules/.bin/vite", "preview", "--host", "0.0.0.0", "--port", "5175"]