-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (30 loc) · 1.28 KB
/
Dockerfile
File metadata and controls
39 lines (30 loc) · 1.28 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
# Multi-stage build for the CoTrackPro Voice Center.
# Build tier compiles TypeScript; runtime tier ships only what's needed
# to run the compiled output. Keeps the final image under ~200MB.
# ── Build stage ──────────────────────────────────────────────────────────
FROM node:20-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY tsconfig*.json ./
COPY src ./src
COPY api ./api
COPY scripts ./scripts
RUN npm run build
# Prune devDependencies so the runtime stage only copies what it needs.
RUN npm prune --omit=dev
# ── Runtime stage ────────────────────────────────────────────────────────
FROM node:20-alpine AS runtime
WORKDIR /app
# tini is a tiny init that forwards signals correctly — important for
# clean WebSocket shutdowns when Fly redeploys the machine.
RUN apk add --no-cache tini
COPY --from=build /app/package*.json ./
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist
ENV NODE_ENV=production
ENV PORT=8080
EXPOSE 8080
USER node
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["node", "dist/index.js"]