-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
37 lines (26 loc) · 808 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
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Start with a Node.js image
FROM node:18-alpine AS builder
# Set the working directory
WORKDIR /app
# Copy package.json and package-lock.json
COPY package.json package-lock.json ./
# Install dependencies
RUN npm install
# Copy the source code
COPY src ./src
# Copy the tsconfig file
COPY tsconfig.json ./
# Build the TypeScript code
RUN npm run build
# Use a smaller image for runtime
FROM node:18-alpine AS runtime
# Set the working directory
WORKDIR /app
# Copy built files and package.json
COPY --from=builder /app/build ./build
COPY --from=builder /app/package.json ./
# Install only production dependencies
RUN npm install --omit=dev
# Set the command to run the server
ENTRYPOINT ["node", "build/index.js"]