Skip to content

Commit bb5b409

Browse files
committed
Added Linting on Docker also
1 parent f1ed9cd commit bb5b409

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,25 @@ WORKDIR /async
66
# Install development dependencies
77
COPY package.json package-lock.json ./
88
RUN npm install
9+
# Install dependencies
10+
RUN npm ci
911

1012
# Copy the rest of the application files
1113
COPY . .
1214

15+
16+
# Run linting during build to catch errors early
17+
RUN npm run lint || exit 1
18+
19+
# Use a separate production stage to keep the image lightweight
20+
FROM node:18-alpine AS development
21+
22+
# Set working directory
23+
WORKDIR /async
24+
25+
# Copy node_modules and built files from builder stage
26+
COPY --from=builder /async /async
27+
1328
# Expose the port for development (if needed)
1429
EXPOSE 3000
1530

0 commit comments

Comments
 (0)