-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
37 lines (26 loc) · 995 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
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use a Node.js image as the base
FROM node:22-alpine AS builder
# Create a directory for the application code
WORKDIR /app
# Copy the package.json and package-lock.json into the working directory
COPY package.json package-lock.json ./
# Install the dependencies
RUN --mount=type=cache,target=/root/.npm npm install
# Copy the application source code
COPY . .
# Build the application
RUN npm run build
# Start a new stage from the smaller Node.js image
FROM node:22-alpine AS release
# Set the working directory
WORKDIR /app
# Copy the build output and node_modules from the builder stage
COPY --from=builder /app/build /app/build
COPY --from=builder /app/node_modules /app/node_modules
# Copy the .env.example as .env (if .env is needed, it should be bind-mounted)
COPY .env.example .env
# Expose the necessary port (if any)
# EXPOSE 3000
# Run the application
ENTRYPOINT ["node", "build/index.js"]