Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,40 @@ WORKDIR /app

# Copy package.json and package-lock.json files
COPY package.json package-lock.json ./
COPY client/package.json client/package-lock.json ./client/
COPY server/package.json server/package-lock.json ./server/
COPY sdk/package.json sdk/package-lock.json ./sdk/
COPY evals-cli/package.json evals-cli/package-lock.json ./evals-cli/

# Install dependencies using package-lock files for consistent versions
RUN npm ci --legacy-peer-deps
RUN cd client && npm ci --legacy-peer-deps
RUN cd server && npm ci --legacy-peer-deps
RUN cd sdk && npm ci --legacy-peer-deps
RUN cd evals-cli && npm ci --legacy-peer-deps
RUN npm --prefix sdk ci --legacy-peer-deps
RUN npm --prefix evals-cli ci --legacy-peer-deps

# Stage 2: Build client
FROM deps-base AS client-builder
COPY shared/ ./shared/
COPY client/ ./client/
COPY tsconfig.json ./
COPY vite.renderer.config.mts ./
COPY vite.main.config.ts ./
COPY vite.preload.config.ts ./
Comment on lines +23 to +25
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify necessity of Electron-specific Vite configs in client build.

The vite.renderer.config.mts, vite.main.config.ts, and vite.preload.config.ts files appear to be Electron-specific configurations. Confirm these are required for the web client Docker build, or if they should be excluded.


🏁 Script executed:

#!/bin/bash
# Description: Check if Electron vite configs are referenced in client build

# Search for references to these configs in client build process
rg -n "vite\.(renderer|main|preload)\.config" client/

# Check the client build script and vite.config.ts
echo "=== Client build command ==="
rg -n "build:client" package.json

echo "=== Client vite.config.ts imports ==="
rg -n "import.*config" client/vite.config.ts

Length of output: 359


🏁 Script executed:

#!/bin/bash
# Find and identify the vite config files
fd "vite\.(renderer|main|preload)" .

# Check Dockerfile full context around line 23-25
echo "=== Dockerfile client-builder stage ==="
sed -n '20,35p' Dockerfile

# Verify these configs aren't used in npm run build:client
echo "=== Check if build:client references these ==="
grep -r "renderer\|preload\|main" client/vite.config.ts || echo "No references found"

Length of output: 589


Remove Electron-specific vite configs from client-builder stage.

The vite.renderer.config.mts, vite.main.config.ts, and vite.preload.config.ts files are Electron-specific configurations not used by the client build (which only uses client/vite.config.ts). These should be removed from lines 23-25.

🤖 Prompt for AI Agents
In Dockerfile around lines 23 to 25, the Dockerfile copies Electron-specific
Vite configs (vite.renderer.config.mts, vite.main.config.ts,
vite.preload.config.ts) into the client-builder stage even though the client
build only needs client/vite.config.ts; remove the three COPY lines so only
client build assets/configs relevant to the client stage are copied, leaving
client/vite.config.ts untouched and ensuring unnecessary Electron configs are
not included in the client-builder image.

COPY .env.production ./
# Set environment variable for Docker platform detection
ENV VITE_DOCKER=true
RUN cd client && npm run build
RUN npm run build:client

# Stage 3: Build SDK (required by server)
FROM deps-base AS sdk-builder
COPY sdk/ ./sdk/
RUN cd sdk && npm run build
RUN npm --prefix sdk run build

# Stage 4: Build server
FROM deps-base AS server-builder
COPY --from=sdk-builder /app/sdk/dist ./sdk/dist
COPY shared/ ./shared/
COPY evals-cli/ ./evals-cli/
COPY server/ ./server/
COPY client/ ./client/
RUN cd server && npm run build
COPY tsconfig.json ./
RUN npm run build:server

# Stage 5: Production image - extend existing or create new
FROM node:20-slim AS production
Expand Down Expand Up @@ -70,8 +70,6 @@ COPY --from=client-builder /app/client/public ./public
# Copy package.json and node_modules for runtime dependencies
COPY --from=deps-base /app/package.json ./package.json
COPY --from=deps-base /app/node_modules ./node_modules
COPY --from=deps-base /app/server/package.json ./server/package.json
COPY --from=deps-base /app/server/node_modules ./server/node_modules

# Copy shared types
COPY shared/ ./shared/
Expand Down
Loading
Loading