-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (28 loc) · 905 Bytes
/
Dockerfile
File metadata and controls
39 lines (28 loc) · 905 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
36
37
38
39
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Stage 1: Build
FROM node:18-alpine AS builder
# Set the working directory
WORKDIR /app
# Copy necessary files for installing dependencies and building the project
COPY package.json pnpm-lock.yaml ./
COPY tsconfig.json ./
COPY src ./src
# Install pnpm package manager
RUN npm install -g pnpm
# Install dependencies
RUN pnpm install
# Build the project
RUN pnpm run build
# Stage 2: Run
FROM node:18-alpine
# Set the working directory
WORKDIR /app
# Copy the built files from the builder stage
COPY --from=builder /app/dist ./dist
COPY package.json pnpm-lock.yaml ./
# Install only production dependencies
RUN pnpm install --prod
# Set environment variable for Google credentials
ENV GOOGLE_APPLICATION_CREDENTIALS=/app/credentials.json
# Define the command to run the application
CMD ["node", "dist/index.js"]