diff --git a/apps/calendar/apps/web/Dockerfile b/apps/calendar/apps/web/Dockerfile index ed87318e7..53c964525 100644 --- a/apps/calendar/apps/web/Dockerfile +++ b/apps/calendar/apps/web/Dockerfile @@ -55,12 +55,18 @@ RUN pnpm build # Production stage FROM node:20-alpine AS production -WORKDIR /app +# Keep same directory structure as builder so pnpm symlinks resolve correctly +WORKDIR /app/apps/calendar/apps/web -# Copy built application and node_modules from builder +# Copy the pnpm store that symlinks point to (at /app/node_modules/.pnpm) +COPY --from=builder /app/node_modules/.pnpm /app/node_modules/.pnpm + +# Copy the app's node_modules (contains symlinks to the pnpm store) +COPY --from=builder /app/apps/calendar/apps/web/node_modules ./node_modules + +# Copy built application COPY --from=builder /app/apps/calendar/apps/web/build ./build COPY --from=builder /app/apps/calendar/apps/web/package.json ./ -COPY --from=builder /app/apps/calendar/apps/web/node_modules ./node_modules # Expose port EXPOSE 5186 diff --git a/apps/chat/apps/web/Dockerfile b/apps/chat/apps/web/Dockerfile index f4bf298fc..544d462a2 100644 --- a/apps/chat/apps/web/Dockerfile +++ b/apps/chat/apps/web/Dockerfile @@ -55,12 +55,18 @@ RUN pnpm build # Production stage FROM node:20-alpine AS production -WORKDIR /app +# Keep same directory structure as builder so pnpm symlinks resolve correctly +WORKDIR /app/apps/chat/apps/web -# Copy built application and node_modules from builder +# Copy the pnpm store that symlinks point to (at /app/node_modules/.pnpm) +COPY --from=builder /app/node_modules/.pnpm /app/node_modules/.pnpm + +# Copy the app's node_modules (contains symlinks to the pnpm store) +COPY --from=builder /app/apps/chat/apps/web/node_modules ./node_modules + +# Copy built application COPY --from=builder /app/apps/chat/apps/web/build ./build COPY --from=builder /app/apps/chat/apps/web/package.json ./ -COPY --from=builder /app/apps/chat/apps/web/node_modules ./node_modules # Expose port EXPOSE 3000 diff --git a/apps/clock/apps/web/Dockerfile b/apps/clock/apps/web/Dockerfile index 06b4bc901..2f5e6c366 100644 --- a/apps/clock/apps/web/Dockerfile +++ b/apps/clock/apps/web/Dockerfile @@ -55,12 +55,18 @@ RUN pnpm build # Production stage FROM node:20-alpine AS production -WORKDIR /app +# Keep same directory structure as builder so pnpm symlinks resolve correctly +WORKDIR /app/apps/clock/apps/web -# Copy built application and node_modules from builder +# Copy the pnpm store that symlinks point to (at /app/node_modules/.pnpm) +COPY --from=builder /app/node_modules/.pnpm /app/node_modules/.pnpm + +# Copy the app's node_modules (contains symlinks to the pnpm store) +COPY --from=builder /app/apps/clock/apps/web/node_modules ./node_modules + +# Copy built application COPY --from=builder /app/apps/clock/apps/web/build ./build COPY --from=builder /app/apps/clock/apps/web/package.json ./ -COPY --from=builder /app/apps/clock/apps/web/node_modules ./node_modules # Expose port EXPOSE 5187 diff --git a/apps/manacore/apps/web/Dockerfile b/apps/manacore/apps/web/Dockerfile index f34e22bc1..b400e79d5 100644 --- a/apps/manacore/apps/web/Dockerfile +++ b/apps/manacore/apps/web/Dockerfile @@ -56,12 +56,18 @@ RUN pnpm build # Production stage FROM node:20-alpine AS production -WORKDIR /app +# Keep same directory structure as builder so pnpm symlinks resolve correctly +WORKDIR /app/apps/manacore/apps/web -# Copy built application and node_modules from builder +# Copy the pnpm store that symlinks point to (at /app/node_modules/.pnpm) +COPY --from=builder /app/node_modules/.pnpm /app/node_modules/.pnpm + +# Copy the app's node_modules (contains symlinks to the pnpm store) +COPY --from=builder /app/apps/manacore/apps/web/node_modules ./node_modules + +# Copy built application COPY --from=builder /app/apps/manacore/apps/web/build ./build COPY --from=builder /app/apps/manacore/apps/web/package.json ./ -COPY --from=builder /app/apps/manacore/apps/web/node_modules ./node_modules # Expose port EXPOSE 5173 diff --git a/apps/todo/apps/web/Dockerfile b/apps/todo/apps/web/Dockerfile index 93ec5e7ee..e29ff1815 100644 --- a/apps/todo/apps/web/Dockerfile +++ b/apps/todo/apps/web/Dockerfile @@ -55,12 +55,18 @@ RUN pnpm build # Production stage FROM node:20-alpine AS production -WORKDIR /app +# Keep same directory structure as builder so pnpm symlinks resolve correctly +WORKDIR /app/apps/todo/apps/web -# Copy built application and node_modules from builder +# Copy the pnpm store that symlinks point to (at /app/node_modules/.pnpm) +COPY --from=builder /app/node_modules/.pnpm /app/node_modules/.pnpm + +# Copy the app's node_modules (contains symlinks to the pnpm store) +COPY --from=builder /app/apps/todo/apps/web/node_modules ./node_modules + +# Copy built application COPY --from=builder /app/apps/todo/apps/web/build ./build COPY --from=builder /app/apps/todo/apps/web/package.json ./ -COPY --from=builder /app/apps/todo/apps/web/node_modules ./node_modules # Expose port EXPOSE 5188