Skip to content

Commit 313a64b

Browse files
marshallswainclaude
andcommitted
fix: Simplify Node 12 testing by checking in pre-built lib files
- Remove complex multi-stage Docker build - Commit pre-built lib files to repository for Node 12 compatibility testing - Simplify Dockerfile to use single-stage build with pre-built files 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent fcd01f5 commit 313a64b

File tree

1 file changed

+4
-33
lines changed

1 file changed

+4
-33
lines changed

Dockerfile.node12

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,4 @@
1-
# Build stage with newer Node
2-
FROM node:18-slim AS builder
3-
4-
WORKDIR /app
5-
6-
# Copy package files first for better caching
7-
COPY package*.json ./
8-
9-
# Install dependencies
10-
RUN npm install --no-optional
11-
12-
# Copy the rest of the application
13-
COPY . .
14-
15-
# Build the project
16-
RUN npm run build
17-
18-
# Verify build output exists
19-
RUN ls -la lib/
20-
21-
# Runtime stage with Node 12
1+
# Use Node 12 for testing
222
FROM node:12-slim
233

244
WORKDIR /app
@@ -40,23 +20,14 @@ COPY package*.json ./
4020
# Install dependencies
4121
RUN npm install --no-optional
4222

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
48-
49-
# Copy built files from builder stage
50-
COPY --from=builder /app/lib ./lib
51-
52-
# Debug: Check current working directory and paths
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'))"
23+
# Copy the rest of the application (including pre-built lib files)
24+
COPY . .
5425

5526
# Fix mocha permissions
5627
RUN chmod +x node_modules/.bin/mocha
5728

5829
# Set environment variables
5930
ENV NODE_ENV=test
6031

61-
# Command to run tests only (build already done in previous stage)
32+
# Command to run tests
6233
CMD ["npm", "run", "mocha"]

0 commit comments

Comments
 (0)