-
Notifications
You must be signed in to change notification settings - Fork 892
Expand file tree
/
Copy pathDockerfile.service
More file actions
47 lines (35 loc) 路 1.3 KB
/
Copy pathDockerfile.service
File metadata and controls
47 lines (35 loc) 路 1.3 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
45
46
47
## Service image: Node (FastMCP) + NGINX sidecar in one container
# 1) Build stage
FROM node:22-alpine AS builder
WORKDIR /app
# Enable pnpm via corepack
RUN corepack enable && corepack prepare pnpm@10.17.1 --activate
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY patches ./patches
# Install dev dependencies for the build, but skip scripts to avoid running
# the package "prepare" script before the source code is copied.
RUN pnpm install --frozen-lockfile --ignore-scripts
COPY . .
RUN pnpm run build
# 2) Runtime stage (Node + NGINX)
FROM node:22-alpine AS runner
WORKDIR /app
# Enable pnpm via corepack
RUN corepack enable && corepack prepare pnpm@10.17.1 --activate
RUN apk add --no-cache nginx bash curl
# Copy built app and install prod deps only
COPY --from=builder /app/dist ./dist
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY patches ./patches
RUN pnpm install --prod --frozen-lockfile --ignore-scripts
# NGINX config and entrypoint
COPY docker/nginx.conf /etc/nginx/nginx.conf
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENV PORT=3000
ENV FASTMCP_ENDPOINT=/v2/mcp
# Second in-process instance (search surface). Internal only, reached by nginx.
# on localhost, never exposed directly.
ENV FIRECRAWL_MCP_SEARCH_PORT=3001
EXPOSE 8080
CMD ["/entrypoint.sh"]