Skip to content

Commit fcd01f5

Browse files
marshallswainclaude
andcommitted
fix: Simplify Docker build to ensure lib directory is preserved
Remove existing lib directory before copying built files from builder stage and add Node.js require path testing to debug the module resolution. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 16e51ec commit fcd01f5

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Dockerfile.node12

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,17 @@ COPY package*.json ./
4040
# Install dependencies
4141
RUN npm install --no-optional
4242

43-
# Copy package files and source files (but not lib directory)
44-
COPY --chown=node:node package*.json ./
45-
COPY --chown=node:node src ./src
46-
COPY --chown=node:node test ./test
47-
COPY --chown=node:node types ./types
48-
COPY --chown=node:node tsconfig.json ./
49-
COPY --chown=node:node .eslintrc.js ./
43+
# Copy all files except lib directory first
44+
COPY --chown=node:node . .
45+
46+
# Remove any existing lib directory to ensure clean copy
47+
RUN rm -rf lib
5048

5149
# Copy built files from builder stage
5250
COPY --from=builder /app/lib ./lib
5351

5452
# Debug: Check current working directory and paths
55-
RUN pwd && ls -la && echo "Contents of lib:" && ls -la lib/
53+
RUN pwd && ls -la && echo "Contents of lib:" && ls -la lib/ && echo "Testing require path:" && node -e "console.log(require.resolve('./lib/error-handler'))"
5654

5755
# Fix mocha permissions
5856
RUN chmod +x node_modules/.bin/mocha

0 commit comments

Comments
 (0)