-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
38 lines (27 loc) · 862 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 a Node.js image
FROM node:18-alpine AS builder
# Install pnpm
RUN npm install -g pnpm
# Set the working directory
WORKDIR /app
# Copy package.json and pnpm-lock.yaml to leverage Docker cache for dependencies
COPY package.json pnpm-lock.yaml ./
# Install dependencies
RUN pnpm install
# Copy the source code
COPY src ./src
COPY tsconfig.json ./
# Build the project
RUN pnpm build
# Use a smaller Node.js image for running the application
FROM node:18-alpine
# Set the working directory
WORKDIR /app
# Copy the built files and package.json
COPY --from=builder /app/build ./build
COPY --from=builder /app/package.json ./
# Install only production dependencies
RUN pnpm install --prod
# Set the entry point for the application
ENTRYPOINT ["node", "build/index.js"]