diff --git a/Dockerfile b/Dockerfile index a65a955..8a45f2d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,19 +31,14 @@ RUN pnpm --filter @kooltab/dashboard run build # ---- Production API image ---- FROM node:20-alpine AS api WORKDIR /app -RUN npm install -g pnpm # Copy built API output COPY --from=builder /app/apps/api/dist ./dist COPY --from=builder /app/apps/api/prisma ./prisma COPY --from=builder /app/apps/api/package.json ./ -# Install only production dependencies -RUN pnpm install --frozen-lockfile --prod - -# Copy shared package (needed at runtime) -COPY --from=builder /app/packages/shared/dist ./node_modules/@kooltab/shared/dist -COPY --from=builder /app/packages/shared/package.json ./node_modules/@kooltab/shared/ +# Copy installed node_modules (includes all deps — fine for production) +COPY --from=builder /app/node_modules ./node_modules EXPOSE 3001 @@ -53,15 +48,14 @@ CMD ["sh", "-c", "npx prisma migrate deploy && node dist/main"] # ---- Production Dashboard image ---- FROM node:20-alpine AS dashboard WORKDIR /app -RUN npm install -g pnpm COPY --from=builder /app/apps/dashboard/.next ./.next COPY --from=builder /app/apps/dashboard/public ./public COPY --from=builder /app/apps/dashboard/package.json ./ COPY --from=builder /app/apps/dashboard/next.config.js ./ -# Install only production dependencies -RUN pnpm install --frozen-lockfile --prod +# Copy installed node_modules +COPY --from=builder /app/node_modules ./node_modules EXPOSE 3000