-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (25 loc) · 1.04 KB
/
Dockerfile
File metadata and controls
35 lines (25 loc) · 1.04 KB
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 the official Node.js 18 image as the base image
FROM node:18-alpine AS builder
# Set the working directory inside the container
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY package.json package-lock.json ./
# Install dependencies (ignoring scripts to prevent premature build)
RUN npm install --ignore-scripts
# Copy the rest of the application code to the container
COPY . .
# Build the TypeScript files
RUN npm run build
# Final stage: Use a smaller Node.js image to run the application
FROM node:18-alpine
# Set the working directory inside the container
WORKDIR /app
# Copy built files 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 production dependencies only
RUN npm install --omit=dev --ignore-scripts
# Command to run the application
ENTRYPOINT ["node", "build/index.js"]