-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (48 loc) · 2.05 KB
/
Copy pathDockerfile
File metadata and controls
62 lines (48 loc) · 2.05 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
54
55
56
57
58
59
60
61
62
# ============================================================
# sparkDash — Multi-DGX Spark Monitoring Dashboard
# Dockerfile for arm64 (DGX Spark GB10 platform)
# ============================================================
FROM node:22-bookworm-slim AS builder
WORKDIR /app
# Install build deps
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc g++ make python3 \
&& rm -rf /var/lib/apt/lists/*
# Copy package files and install (retry — npm in Docker can flake with
# "Exit handler never called!" on a single long ci run)
COPY package.json package-lock.json* ./
RUN npm ci --no-audit --no-fund \
|| (echo "npm ci failed once — retrying…" && npm cache clean --force && npm ci --no-audit --no-fund)
# Copy source and build
COPY . .
RUN npm run build
# Drop devDependencies so the runtime image can copy node_modules
# (avoids a second `npm ci --omit=dev`, which has been flaky in Docker:
# "Exit handler never called!")
RUN npm prune --omit=dev --no-audit --no-fund \
|| (npm install --omit=dev --no-audit --no-fund && npm prune --omit=dev --no-audit --no-fund)
# ============================================================
# Production image — lean runtime
# ============================================================
FROM node:22-bookworm-slim
# SSH client + sshpass for remote Sparks; util-linux provides nsenter for host GPU/net
RUN apt-get update && apt-get install -y --no-install-recommends \
openssh-client sshpass procps util-linux iproute2 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy built frontend, pruned deps, and server
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/package-lock.json ./package-lock.json
COPY --from=builder /app/server ./server
COPY --from=builder /app/config ./config
# Volume for persistent sparks.json
VOLUME /app/config
# Expose dashboard port
EXPOSE 5555
# Default environment
ENV PORT=5555
ENV LLM_PORT=8888
ENV NODE_ENV=production
CMD ["node", "server/index.js"]