@@ -32,6 +32,16 @@ phases:
3232 - echo "Installing API dependencies only..."
3333 - bun install --filter=@comp/api --frozen-lockfile || bun install --filter=@comp/api --ignore-scripts || bun install --ignore-scripts
3434
35+ # Build workspace dependencies (ui -> email)
36+ - echo "Building @trycompai/ui package..."
37+ - cd packages/ui
38+ - bun run build
39+ - cd ../..
40+ - echo "Building @trycompai/email package..."
41+ - cd packages/email
42+ - bun run build
43+ - cd ../..
44+
3545 # Build NestJS application (prebuild automatically handles Prisma)
3646 - echo "Building NestJS application..."
3747 - echo "APP_NAME is set to $APP_NAME"
@@ -69,6 +79,23 @@ phases:
6979 # Copy entire node_modules for runtime (includes @trycompai/db from npm)
7080 - echo "Skipping host node_modules copy; Dockerfile installs prod deps inside image"
7181
82+ # Copy built workspace packages (needed for runtime)
83+ # These packages are built above and need to be available in Docker
84+ - echo "Copying built workspace packages..."
85+ - mkdir -p ../docker-build/node_modules/@trycompai
86+ # Email package - copy dist and package.json
87+ - mkdir -p ../docker-build/node_modules/@trycompai/email
88+ - cp -r ../../packages/email/dist ../docker-build/node_modules/@trycompai/email/
89+ - cp ../../packages/email/package.json ../docker-build/node_modules/@trycompai/email/
90+ # UI package - copy dist and package.json
91+ - mkdir -p ../docker-build/node_modules/@trycompai/ui
92+ - cp -r ../../packages/ui/dist ../docker-build/node_modules/@trycompai/ui/
93+ - cp ../../packages/ui/package.json ../docker-build/node_modules/@trycompai/ui/
94+ # Utils package - copy src (no build step) and package.json
95+ - mkdir -p ../docker-build/node_modules/@trycompai/utils
96+ - cp -r ../../packages/utils/src ../docker-build/node_modules/@trycompai/utils/
97+ - cp ../../packages/utils/package.json ../docker-build/node_modules/@trycompai/utils/
98+
7299 # Copy Dockerfile
73100 - echo "Copying Dockerfile..."
74101 - cp Dockerfile ../docker-build/
0 commit comments