-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (27 loc) · 966 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
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use Node.js 22.12-alpine as the base image
FROM node:22.12-alpine AS builder
# Create and change to the app directory
WORKDIR /app
# Copy package.json and package-lock.json
COPY package.json package-lock.json ./
# Install dependencies
RUN --mount=type=cache,target=/root/.npm npm ci
# Copy the source code
COPY src ./src
COPY tsconfig.json ./
# Build the TypeScript source
RUN npm run build
# Create a new release image
FROM node:22-alpine AS release
# Set the working directory
WORKDIR /app
# Copy the built application and the necessary files
COPY --from=builder /app/dist /app/dist
COPY --from=builder /app/package.json /app/package-lock.json ./
# Set the environment variable for production
ENV NODE_ENV=production
# Install only production dependencies
RUN npm ci --ignore-scripts --omit=dev
# Set the command to run the server
ENTRYPOINT ["node", "dist/index.js"]