-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
33 lines (23 loc) · 783 Bytes
/
dockerfile
File metadata and controls
33 lines (23 loc) · 783 Bytes
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
# --- Stage 1: Build ---
FROM node:18-alpine AS builder
# Install build tools for node-pty (Native C++ Module)
RUN apk add --no-cache python3 make g++
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY tsconfig.json ./
COPY src ./src
RUN npm run build
# --- Stage 2: Production Runner ---
FROM node:18-alpine
# Production needs these tools/libs for the native binary runtime
RUN apk add --no-cache util-linux python3 make g++
WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/package.json ./
COPY --from=builder /app/package-lock.json ./
# We copy node_modules from builder because node-pty is compiled there
COPY --from=builder /app/node_modules ./node_modules
ENV NODE_ENV=production
ENV INTERVAL=60
CMD ["node", "dist/index.js"]