-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathDockerfile
32 lines (23 loc) · 858 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
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use an official Node.js runtime as a parent image
FROM node:18-alpine AS build
# Set the working directory in the container
WORKDIR /app
# Copy the package files and install the dependencies
COPY package.json package-lock.json ./
RUN npm install --ignore-scripts
# Copy the rest of the application
COPY . .
# Build the TypeScript code
RUN npm run build
# Use a lighter image for the runtime
FROM node:18-alpine AS runtime
WORKDIR /app
# Copy the built application from the build stage
COPY --from=build /app/dist ./dist
COPY --from=build /app/package.json ./package.json
COPY --from=build /app/package-lock.json ./package-lock.json
# Install only production dependencies
RUN npm ci --omit=dev
# Command to run the application
ENTRYPOINT ["node", "dist/index.js"]