Skip to content

fix: resolved issue building docker - #146

Merged
RedStar071 merged 2 commits into
mainfrom
fix/resolve-issue-from-building-docker
Nov 28, 2025
Merged

RedStar071 merged 2 commits into
mainfrom
fix/resolve-issue-from-building-docker

Conversation

@RedStar071

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings November 28, 2025 13:02
@RedStar071 RedStar071 self-assigned this Nov 28, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR attempts to fix Docker build issues by moving the husky package from devDependencies to dependencies and adjusting the Dockerfile build process. However, the changes introduce semantic and functional issues that should be addressed.

Key Changes

  • Moved husky from devDependencies to dependencies in package.json (with corresponding pnpm-lock.yaml updates)
  • Changed ENV CI=true to ENV HUSKY="0" in Dockerfile
  • Modified runner stage to copy prisma/ schema directory instead of copying pre-built .prisma files from builder stage

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
package.json Moves husky from devDependencies to dependencies, which is semantically incorrect for a dev-only Git hooks tool
pnpm-lock.yaml Updates lock file to reflect husky's new location in the dependency tree
Dockerfile Changes environment variable from CI to HUSKY and restructures production stage to copy prisma schema instead of built artifacts, which may cause build failures
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
Comment on lines +89 to +90
"zlib-sync": "^0.1.10",
"husky": "^9.1.7"

Copilot AI Nov 28, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving husky from devDependencies to dependencies is semantically incorrect and unnecessarily increases the production bundle size. Husky is a development tool for Git hooks and should not be in production dependencies.

The root issue is that the prepare script runs husky during pnpm install --prod in the runner stage (line 53), but husky isn't available when it's in devDependencies.

Better solutions:

  1. Use pnpm install --prod --frozen-lockfile --ignore-scripts in the runner stage and copy the built .prisma from builder
  2. Or update the prepare script to check for HUSKY environment variable: "prepare": "node -e \"if(process.env.HUSKY !== '0') require('husky').install()\"" (though husky v9 should already handle HUSKY=0)

Copilot uses AI. Check for mistakes.
Comment thread Dockerfile Outdated
Comment on lines +51 to +53
COPY --chown=node:node prisma/ prisma/

RUN pnpm install --prod --frozen-lockfile

Copilot AI Nov 28, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The runner stage now copies the prisma/ schema directory and runs pnpm install --prod --frozen-lockfile, which will trigger Prisma Client generation via @prisma/client's postinstall script. However, the prisma CLI (required for generation) is in devDependencies and won't be installed with --prod. This will likely cause the production build to fail.

The previous approach of copying the pre-built .prisma directory from the builder stage was more efficient and correct. Consider reverting to:

RUN pnpm install --prod --frozen-lockfile

# Patch .prisma with the built files  
COPY --chown=node:node --from=builder /usr/src/app/node_modules/.prisma node_modules/.prisma
Suggested change
COPY --chown=node:node prisma/ prisma/
RUN pnpm install --prod --frozen-lockfile
# Copy pre-built Prisma Client from builder stage
RUN pnpm install --prod --frozen-lockfile
COPY --chown=node:node --from=builder /usr/src/app/node_modules/.prisma node_modules/.prisma

Copilot uses AI. Check for mistakes.
@RedStar071
RedStar071 merged commit 4b6cd4c into main Nov 28, 2025
@RedStar071
RedStar071 deleted the fix/resolve-issue-from-building-docker branch November 28, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants