fix(docker): Use TurboRepo to build workspace dependencies
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
The Docker builds were failing because they ran `pnpm build` directly
in the app directories without first building workspace dependencies
(@mosaic/shared, @mosaic/ui). CI passed because it runs TurboRepo
from the root which respects the dependency graph.
Changed both Dockerfiles to use `pnpm turbo build --filter=@mosaic/{app}`
which ensures dependencies are built in the correct order:
- Web: @mosaic/config → @mosaic/shared → @mosaic/ui → @mosaic/web
- API: @mosaic/config → @mosaic/shared → prisma:generate → @mosaic/api
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -39,15 +39,13 @@ COPY --from=deps /app/apps/web/node_modules ./apps/web/node_modules
|
||||
COPY packages ./packages
|
||||
COPY apps/web ./apps/web
|
||||
|
||||
# Set working directory to web app
|
||||
WORKDIR /app/apps/web
|
||||
|
||||
# Build arguments for Next.js
|
||||
ARG NEXT_PUBLIC_API_URL
|
||||
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
||||
|
||||
# Build the application
|
||||
RUN pnpm build
|
||||
# Build the web app and its dependencies using TurboRepo
|
||||
# This ensures @mosaic/shared and @mosaic/ui are built first
|
||||
RUN pnpm turbo build --filter=@mosaic/web
|
||||
|
||||
# ======================
|
||||
# Production stage
|
||||
|
||||
Reference in New Issue
Block a user