-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
39 lines (28 loc) · 972 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
# Use Node.js 18 LTS (Gallium) as the base image
FROM node:18-bullseye-slim AS builder
# Set the working directory in the container
WORKDIR /app
# Copy the package.json and package-lock.json to the working directory
COPY package*.json ./
# Install the dependencies
RUN npm install
# Copy the entire application to the working directory
COPY . .
# Build the application
RUN npm run build
# Use a smaller base image for production
FROM node:18-bullseye-slim AS production
# Set the working directory in the container
WORKDIR /app
# Copy the built files and dependencies from the builder stage
COPY --from=builder /app/build ./build
COPY --from=builder /app/node_modules ./node_modules
COPY package.json ./
# Set environment variables
ENV NODE_ENV=production
ENV SERVER_MODE=stdio
# Expose the port the app runs on
EXPOSE 3000
# Start the application
CMD ["node", "build/cli.js"]