File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,8 @@ jobs:
100100 # This ensures Docker rebuilds the prisma layer when the submodule is updated
101101 PRISMA_COMMIT=$(git submodule status prisma | awk '{print $1}' | sed 's/^+//')
102102 echo "Using Prisma submodule commit: $PRISMA_COMMIT"
103- # Use 'codebuilder' as the stack prefix with build-arg to bust cache
103+
104+ # Build with the prisma commit as a build argument
104105 docker compose -p codebuilder build --build-arg PRISMA_COMMIT=$PRISMA_COMMIT api
105106
106107 # Step 5: Forcefully remove the old api container to prevent conflicts.
Original file line number Diff line number Diff line change @@ -13,9 +13,6 @@ COPY package.json pnpm-lock.yaml ./
1313# Add a build argument to bust cache when the submodule changes
1414# This ensures that Docker will re-copy the prisma directory when the submodule is updated
1515ARG PRISMA_COMMIT
16- # Copy the prisma directory
17- COPY prisma ./prisma
18-
1916
2017# Install dependencies
2118RUN pnpm install --unsafe-perm \
@@ -30,6 +27,12 @@ RUN pnpm install --unsafe-perm \
3027 && echo '--- DEBUG: node_modules/.bin contents ---' \
3128 && ls -l node_modules/.bin || true
3229
30+ # Copy prisma directory and generate client based on the commit
31+ # This creates a single layer that will be invalidated when PRISMA_COMMIT changes
32+ COPY prisma ./prisma
33+ RUN echo "Prisma commit: ${PRISMA_COMMIT:-unknown}" > /tmp/prisma-commit \
34+ && npx prisma generate
35+
3336# Copy the rest of your application code
3437COPY . .
3538
You can’t perform that action at this time.
0 commit comments