-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
39 lines (27 loc) · 939 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
39
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Base image for building TypeScript
FROM node:20-alpine AS builder
# Set working directory
WORKDIR /app
# Copy package.json and package-lock.json
COPY package.json package-lock.json ./
# Install dependencies without running scripts to avoid prepare script before build
RUN npm install --ignore-scripts
# Copy source files
COPY src/ src/
# Build the TypeScript files
RUN npm run build
# Production image
FROM node:20-alpine AS production
# Set working directory
WORKDIR /app
# Copy built files from builder
COPY --from=builder /app/build/ /app/build/
# Copy package.json and package-lock.json for production installation
COPY package.json package-lock.json ./
# Install only production dependencies
RUN npm ci --omit=dev
# Set environment variables
ENV NODE_ENV=production
# Command to run the application
ENTRYPOINT ["node", "build/index.js"]