-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (25 loc) · 943 Bytes
/
Copy pathDockerfile
File metadata and controls
35 lines (25 loc) · 943 Bytes
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
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use Node.js 18 for compatibility with project requirements
FROM node:18-alpine AS builder
# Set the working directory
WORKDIR /app
# Copy package.json and package-lock.json to install dependencies
COPY package.json package-lock.json ./
# Install dependencies
RUN npm install
# Copy the entire source code
COPY . .
# Build the project using TypeScript
RUN npm run build
# Create a new stage for the release image
FROM node:18-alpine AS release
# Set the working directory
WORKDIR /app
# Copy built files and necessary configs from the builder stage
COPY --from=builder /app/build /app/build
COPY --from=builder /app/package.json /app/package.json
COPY --from=builder /app/package-lock.json /app/package-lock.json
# Install only production dependencies
RUN npm ci --omit=dev
# Set the command to run the server
ENTRYPOINT ["node", "build/index.js"]