-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
40 lines (28 loc) · 913 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
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Stage 1: Build
FROM node:20-alpine AS builder
# Set the working directory
WORKDIR /app
# Copy package files and install dependencies
COPY package.json package-lock.json ./
RUN npm install
# Copy the entire source directory
COPY src ./src
# Copy the TypeScript configuration
COPY tsconfig.json ./
# Compile TypeScript to JavaScript
RUN npm run build
# Stage 2: Production
FROM node:20-alpine
# Set the working directory
WORKDIR /app
# Copy compiled files from the builder stage
COPY --from=builder /app/build ./build
# Copy necessary package files
COPY package.json package-lock.json ./
# Install production dependencies only
RUN npm install --production
# Set environment variables for database configuration
ENV NODE_ENV=production
# Specify the command to run the MCP server
ENTRYPOINT ["node", "build/index.js"]