-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (25 loc) · 890 Bytes
/
Dockerfile
File metadata and controls
35 lines (25 loc) · 890 Bytes
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 Node.js 18 base image
FROM node:18-alpine AS builder
# Set working directory
WORKDIR /app
# Copy all source files first
COPY . .
# Install all dependencies including dev dependencies
RUN npm ci
# Build the TypeScript files
RUN npm run build
# Use a smaller base image for the release
FROM node:18-slim AS release
# Set working directory
WORKDIR /app
# Copy only the necessary files from builder
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 only production dependencies without running prepare script
RUN npm ci --omit=dev --ignore-scripts
# Set environment variable for Node.js
ENV NODE_ENV=production
# Set the entrypoint
ENTRYPOINT ["node", "build/index.js"]