forked from firecrawl/firecrawl-mcp-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (30 loc) · 1.35 KB
/
Dockerfile
File metadata and controls
44 lines (30 loc) · 1.35 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 a Node.js image as the base for building the application
FROM node:22-alpine AS builder
# Enable pnpm via corepack
RUN corepack enable && corepack prepare pnpm@latest --activate
# Set the working directory inside the container
WORKDIR /app
# Copy package.json and pnpm-lock.yaml to install dependencies
COPY package.json pnpm-lock.yaml ./
# Install dependencies (ignoring scripts to prevent running the prepare script)
RUN pnpm install --frozen-lockfile --ignore-scripts
# Copy the rest of the application source code
COPY . .
# Build the application using TypeScript
RUN pnpm run build
# Use a smaller Node.js image for the final image
FROM node:22-slim AS release
# Enable pnpm via corepack
RUN corepack enable && corepack prepare pnpm@latest --activate
# Set the working directory inside the container
WORKDIR /app
# Copy the built application from the builder stage
COPY --from=builder /app/dist /app/dist
COPY --from=builder /app/package.json /app/package.json
COPY --from=builder /app/pnpm-lock.yaml /app/pnpm-lock.yaml
# Install only production dependencies
RUN pnpm install --prod --frozen-lockfile --ignore-scripts
# Set environment variables for API key and custom API URL if needed
# Specify the command to run the application
ENTRYPOINT ["node", "dist/index.js"]