-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDockerfile
41 lines (29 loc) · 1.06 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
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use a Node.js image as the base image
FROM node:18-alpine AS builder
# Create a working directory
WORKDIR /app
# Copy package files and tsconfig.json for installation
COPY package.json package-lock.json tsconfig.json ./
# Install dependencies and cache them
RUN --mount=type=cache,target=/root/.npm npm install
# Copy the rest of the application code
COPY . .
# Build the project
RUN npm run build
# Production stage
FROM node:18-alpine AS release
# Set working directory
WORKDIR /app
# Copy compiled files from builder
COPY --from=builder /app/dist /app/dist
COPY --from=builder /app/package.json /app/package.json
COPY --from=builder /app/package-lock.json /app/package-lock.json
# Set environment to production
ENV NODE_ENV=production
# Install only production dependencies
RUN npm ci --omit=dev
# Define environment variable for the Supabase API key
ENV SUPABASE_API_KEY=YOUR_API_KEY_HERE
# Set the entry point to the compiled JavaScript file
ENTRYPOINT ["node", "dist/index.js"]