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
21 changes: 18 additions & 3 deletions apps/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,36 @@ FROM node:20-alpine AS builder
RUN apk add --no-cache libc6-compat

WORKDIR /app
COPY package.json ./

# Copy root configuration
COPY package.json package-lock.json* turbo.json tsconfig.json ./

# Copy workspace package.json files
COPY apps/web/package.json ./apps/web/
COPY apps/api/packages/crypto/package.json ./apps/api/packages/crypto/
COPY apps/api/packages/shared/package.json ./apps/api/packages/shared/

# Install dependencies
RUN npm install
COPY . .

# Copy source code
COPY apps/web ./apps/web
COPY apps/api/packages/crypto ./apps/api/packages/crypto
COPY apps/api/packages/shared ./apps/api/packages/shared

ARG VITE_API_URL
ENV VITE_API_URL=$VITE_API_URL
ENV CI=true

# Build the web application
WORKDIR /app/apps/web
RUN npm run build
Comment on lines +29 to 31
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

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

The build process will fail because the dependent packages (@handoverkey/crypto and @handoverkey/shared) are not built before building the web application. These packages need to be compiled from TypeScript to their dist directories before the web app can import them. Consider building the dependencies first by either: 1) Using turbo to build from the root with "turbo run build --filter=@handoverkey/web", or 2) Explicitly building crypto and shared packages before changing to the web directory.

Suggested change
# Build the web application
WORKDIR /app/apps/web
RUN npm run build
# Build the web application and its dependencies using Turborepo
WORKDIR /app
RUN npx turbo run build --filter=@handoverkey/web

Copilot uses AI. Check for mistakes.

# STAGE 2: Run the application
FROM node:20-alpine AS runner
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

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

The Docker image in the runner stage uses Node.js 20, but the package.json at the root specifies engines requiring node >= 22.0.0. This version mismatch could lead to runtime issues. Update the base image to use node:22-alpine to match the project's requirements.

Copilot uses AI. Check for mistakes.
WORKDIR /app
RUN npm install -g serve
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/apps/web/dist ./dist
ENV PORT=3000
EXPOSE 3000
CMD ["serve", "-s", "dist", "-l", "3000"]
4 changes: 2 additions & 2 deletions docker-compose.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ services:

web:
build:
context: ./apps/web
dockerfile: Dockerfile
context: .
dockerfile: apps/web/Dockerfile
args:
# Pass API URL to build time
VITE_API_URL: ${VITE_API_URL:-https://api.handoverkey.com/api/v1}
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ services:

web:
build:
context: ./apps/web
dockerfile: Dockerfile
context: .
dockerfile: apps/web/Dockerfile
args:
# Pass API URL to build time for Vite
VITE_API_URL: http://localhost:3001/api/v1
Expand Down