-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (25 loc) · 1.02 KB
/
Dockerfile
File metadata and controls
36 lines (25 loc) · 1.02 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
# Stage 1 — compile TypeScript
FROM node:22-alpine AS builder
RUN corepack enable pnpm
WORKDIR /app
# Restore dependencies before copying source for layer-cache efficiency
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml tsconfig.json ./
COPY packages/ts/whistlers/package.json packages/ts/whistlers/tsconfig.json ./packages/ts/whistlers/
RUN pnpm install --frozen-lockfile
COPY packages/ts/whistlers/src ./packages/ts/whistlers/src
RUN pnpm -r build
# Stage 2 — lean runtime image
FROM node:22-alpine
ARG VERSION=""
ENV VERSION=$VERSION
LABEL maintainer="Drakkar-Software" \
version="${VERSION}" \
description="Whistlers — message-queue-to-destination bridge"
WORKDIR /app
# Copy the full pnpm virtual store and compiled output from builder
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/packages/ts/whistlers/dist ./dist
COPY --from=builder /app/packages/ts/whistlers/package.json ./
VOLUME /etc/whistlers
ENTRYPOINT ["node", "dist/bin/server.js"]
CMD ["/etc/whistlers/config.json"]