File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed
Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 9696
9797 # Step 4: Build the latest api image.
9898 echo "Building the latest api image..."
99- # Use 'codebuilder' as the stack prefix
100- docker compose -p codebuilder build api
99+ # Get the current commit hash of the prisma submodule
100+ # This ensures Docker rebuilds the prisma layer when the submodule is updated
101+ PRISMA_COMMIT=$(git submodule status prisma | awk '{print $1}' | sed 's/^+//')
102+ echo "Using Prisma submodule commit: $PRISMA_COMMIT"
103+ # Use 'codebuilder' as the stack prefix with build-arg to bust cache
104+ docker compose -p codebuilder build --build-arg PRISMA_COMMIT=$PRISMA_COMMIT api
101105
102106 # Step 5: Forcefully remove the old api container to prevent conflicts.
103107 echo "Forcefully removing old api container if it exists..."
Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ RUN npm install -g pnpm
99
1010# Copy package manifests and lockfile
1111COPY package.json pnpm-lock.yaml ./
12+
13+ # Add a build argument to bust cache when the submodule changes
14+ # This ensures that Docker will re-copy the prisma directory when the submodule is updated
15+ ARG PRISMA_COMMIT
16+ # Copy the prisma directory
1217COPY prisma ./prisma
1318
1419
Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ services:
2525 build :
2626 context : .
2727 dockerfile : Dockerfile
28+ args :
29+ - PRISMA_COMMIT=${PRISMA_COMMIT:-latest}
2830 container_name : codebuilder-api
2931 restart : unless-stopped
3032 env_file :
You can’t perform that action at this time.
0 commit comments