Skip to content

Commit 46b85ff

Browse files
committed
chore(docker): update Dockerfile to use Node.js 20 and streamline build process
1 parent a02eb37 commit 46b85ff

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

Dockerfile

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
2-
FROM node:lts-alpine
1+
FROM node:20-alpine AS builder
32

43
# Create app directory
54
WORKDIR /app
@@ -16,12 +15,21 @@ COPY . .
1615
# Build the application
1716
RUN npm run build
1817

18+
# Use Node.js 20 Alpine as the base image for the runtime stage
19+
FROM node:20-alpine AS runner
20+
21+
# Set the working directory for the runtime stage
22+
WORKDIR /app
23+
24+
# Copy the built application and dependencies from the builder stage
25+
COPY --from=builder /app/package*.json ./
26+
COPY --from=builder /app/build ./build
27+
28+
RUN npm install --ignore-scripts --omit=dev
29+
30+
# Define environment variables
1931
ENV LEETCODE_SITE=global \
2032
LEETCODE_SESSION=
2133

22-
# Expose any port if needed (MCP uses stdio, so not required for now)
23-
2434
# Set the default command
25-
CMD node build/index.js \
26-
--site ${LEETCODE_SITE:-global} \
27-
--session ${LEETCODE_SESSION}
35+
ENTRYPOINT ["node","build/index.js"]

0 commit comments

Comments
 (0)