-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.router
More file actions
38 lines (29 loc) · 1.06 KB
/
Dockerfile.router
File metadata and controls
38 lines (29 loc) · 1.06 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
# Minimal router image - Node.js with BullMQ and Dockerode for orchestration
FROM node:22-slim AS builder
WORKDIR /app
# Install dependencies
COPY package*.json .npmrc ./
RUN npm ci --ignore-scripts
# Build
COPY tsconfig.json ./
COPY src ./src
RUN npm run build
# Production image - minimal Node.js
FROM node:22-slim AS production
WORKDIR /app
# `cascade.managed=true` is the contract the router's dangling-image cleanup
# loop filters on (src/router/dangling-image-cleanup.ts). Without this LABEL,
# the loop matches zero images and reclaims nothing — see PR #1256.
LABEL cascade.managed=true
# Install curl for health checks
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
# Install only production dependencies
COPY package*.json .npmrc ./
RUN npm ci --omit=dev --ignore-scripts
# Copy entire built output — avoids missing-module breaks when router gains new imports
COPY --from=builder /app/dist ./dist
# Copy config
COPY config ./config
ENV PORT=3000
EXPOSE 3000
CMD ["node", "--import", "./dist/instrument.js", "dist/router/index.js"]