-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
42 lines (31 loc) · 1.12 KB
/
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
40
41
42
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Stage 1: Build the application
FROM node:22.12-alpine AS builder
# Set the working directory
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY package.json package-lock.json ./
# Install the dependencies
RUN --mount=type=cache,target=/root/.npm npm install --ignore-scripts
# Copy the rest of the application code
COPY src ./src
COPY tsconfig.json ./
# Build the application
RUN npm run build
# Stage 2: Run the application
FROM node:22-alpine AS release
# Set the working directory
WORKDIR /app
# Copy the build output and package files from the builder stage
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 production dependencies
RUN npm ci --omit=dev --ignore-scripts
# Set environment variables
ENV CLIENT_ID=<YOUR_CLIENT_ID>
ENV CLIENT_SECRET=<YOUR_CLIENT_SECRET>
ENV EMAIL=<YOUR_EMAIL>
ENV PASSWORD=<YOUR_PASSWORD>
# Command to run the application
ENTRYPOINT ["node", "build/index.js"]