-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathDockerfile
42 lines (29 loc) · 929 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Stage 1: Build the application using Node.js
FROM node:18-alpine AS builder
# Set working directory
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY package.json package-lock.json ./
# Install dependencies
RUN npm install
# Copy source files
COPY src ./src
# Build the project
RUN npm run build
# Stage 2: Create a lightweight image for production
FROM node:18-alpine
# Set working directory
WORKDIR /app
# Copy built files from builder
COPY --from=builder /app/build ./build
# Copy necessary files
COPY package.json package-lock.json ./
# Install only production dependencies
RUN npm install --omit=dev
# Environment variables
ENV NODE_ENV=production
# Entrypoint command to run the MCP server
ENTRYPOINT ["node", "build/index.js"]
# Command to start the server
CMD ["node", "build/index.js"]