forked from StuMason/coolify-mcp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.docs
More file actions
53 lines (44 loc) · 1.97 KB
/
Copy pathDockerfile.docs
File metadata and controls
53 lines (44 loc) · 1.97 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
48
49
50
51
52
53
# Build + serve coolify-mcp.stumason.dev (Astro, SSR on Node).
#
# Node at runtime rather than static nginx, because /api/contact posts the
# contact form to SES and needs a server. The landing page itself is
# prerendered, so it is served as flat HTML with no per-request render.
#
# Preserves the repo layout (/app/site + /app/src) because the build reads
# src/lib/mcp-server.ts to count the tools — see countTools() in
# site/astro.config.mjs. Hardcoding that number is how the old site ended up
# claiming 42 and 44 on the same page.
FROM node:22-alpine AS builder
WORKDIR /app/site
COPY site/package.json site/package-lock.json ./
RUN npm ci
WORKDIR /app
# The tool count is derived from this at build time.
COPY src/lib/mcp-server.ts ./src/lib/mcp-server.ts
COPY site/ ./site/
WORKDIR /app/site
RUN npm run build
# ── runtime ──────────────────────────────────────────────────────────────────
FROM node:22-alpine
ENV NODE_ENV=production
ENV HOST=0.0.0.0
ENV PORT=4321
WORKDIR /app
# curl, for Coolify's container healthcheck.
#
# Without it the check falls back to busybox wget, which resolves `localhost`
# to ::1 and stops there. Node binds 0.0.0.0 — IPv4 only — so every probe came
# back "connection refused" against a server that was running perfectly, the
# rolling update judged the container unhealthy, and it rolled back. curl tries
# IPv6 then falls back to IPv4, so it succeeds either way; the healthcheck is
# also pinned to 127.0.0.1 in the Coolify app config.
RUN apk add --no-cache curl
# Production dependencies only — the AWS SDK is needed at runtime for the
# contact form; astro and the adapter are not.
COPY site/package.json site/package-lock.json ./
RUN npm ci --omit=dev && npm cache clean --force
COPY --from=builder /app/site/dist ./dist
# Don't run the server as root.
USER node
EXPOSE 4321
CMD ["node", "./dist/server/entry.mjs"]