-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (30 loc) · 1.51 KB
/
Copy pathDockerfile
File metadata and controls
35 lines (30 loc) · 1.51 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
# ARS3NAL — offline pentest payload toolkit, containerized.
# Fastify + better-sqlite3 API serving the built Vite frontend. Fully offline, one port.
# ---- build stage: compile the native addon + build the frontend ----
FROM node:22-bookworm-slim AS build
# better-sqlite3 builds a native addon at install time -> needs a compiler toolchain (build stage only).
RUN apt-get update \
&& apt-get install -y --no-install-recommends python3 make g++ ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build # vite -> web/dist (the embedded CyberChef bundle ships inside it)
# ---- runtime stage: slim, no compiler toolchain, no duplicate source ----
FROM node:22-bookworm-slim
WORKDIR /app
# node_modules carries the already-compiled better-sqlite3 + tsx (same base image -> ABI-compatible).
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/package.json ./package.json
COPY --from=build /app/tsconfig.json ./tsconfig.json
COPY --from=build /app/server ./server
COPY --from=build /app/seed ./seed
COPY --from=build /app/web/dist ./web/dist
ENV HOST=0.0.0.0 \
PORT=7331
EXPOSE 7331
# Seed on every start: the seed is idempotent and preserves user data (custom entries, notes,
# favorites, checklist progress, engagements), so this refreshes the bundled content on an image
# rebuild while keeping your data intact. First run seeds into the empty /app/data volume.
CMD ["sh", "-c", "mkdir -p data && npm run seed && exec npm run start"]