forked from wadecalvin9/ByteCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (37 loc) · 1.04 KB
/
Dockerfile
File metadata and controls
49 lines (37 loc) · 1.04 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
# Stage 1: Build Dashboard
FROM node:20-alpine AS dashboard-build
WORKDIR /app/dashboard
COPY dashboard/package*.json ./
RUN npm install
COPY dashboard/ ./
RUN npm run build
# Stage 2: Server & Final Image
FROM node:20-alpine
WORKDIR /app
# Install native build tools and Go for payload generation
RUN apk add --no-cache python3 make g++ go
# Set environment for Go cross-compilation
ENV GOOS=windows
ENV GOARCH=amd64
ENV CGO_ENABLED=0
# Install dependencies for server
COPY server/package*.json ./server/
RUN cd server && npm install
# Copy server source
COPY server/ ./server/
# Copy agent source (required for payload builder)
COPY agent/ ./agent/
RUN cd agent && go mod download
# Copy built dashboard from Stage 1
COPY --from=dashboard-build /app/dashboard/dist ./dashboard/dist
# Copy CLI tool
COPY bin/ ./bin/
COPY package.json ./
# Create directories
RUN mkdir -p /app/server/data /app/exfiltrated_files /app/payloads
# Environment variables
ENV NODE_ENV=production
ENV PORT=3001
EXPOSE 3001
# Start the server
CMD ["node", "server/src/index.js"]