chore(profile/e2e): 🔧 Update Dockerfiles for optimized E2E test environments with adjusted base images, dependencies, and resource configurations
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
ee028dac36
commit
b65fa4b787
2 changed files with 13 additions and 18 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue