-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (31 loc) · 1.14 KB
/
Dockerfile
File metadata and controls
44 lines (31 loc) · 1.14 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
36
37
38
39
40
41
42
43
44
# 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-slim AS build
# Set the working directory in the container
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY package.json package-lock.json ./
# Install the project dependencies
RUN npm install
# Copy the rest of the application code
COPY . .
# Build the application
RUN npm run build
# Create a new stage for the production image
FROM node:18-slim
# Set the working directory in the container
WORKDIR /app
# Copy the built application from the build stage
COPY --from=build /app/build /app/build
COPY --from=build /app/package.json /app/package.json
COPY --from=build /app/package-lock.json /app/package-lock.json
# Install only production dependencies
RUN npm ci --omit=dev
# Set environment variable for the reports directory
ENV MAIGRET_REPORTS_DIR=/app/reports
# Create the reports directory
RUN mkdir -p $MAIGRET_REPORTS_DIR
# Expose the port on which the application will run
EXPOSE 3000
# Command to run the application
ENTRYPOINT ["node", "build/index.js"]