Skip to content

Commit 2b11300

Browse files
marshallswainclaude
andcommitted
fix: Copy source files selectively to avoid overwriting lib directory
Instead of copying all files with 'COPY . .', copy specific directories and files to avoid overwriting the built lib directory from the builder stage. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent e3da6d7 commit 2b11300

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Dockerfile.node12

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

43-
# Copy the rest of the application
44-
COPY . .
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 ./
4550

4651
# Copy built files from builder stage
4752
COPY --from=builder /app/lib ./lib

0 commit comments

Comments
 (0)