forked from Shonen-Labs/StarkFinder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.agent
More file actions
74 lines (63 loc) · 1.44 KB
/
Dockerfile.agent
File metadata and controls
74 lines (63 loc) · 1.44 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
63
64
65
66
67
68
69
70
71
72
73
74
FROM node:20-slim AS builder
WORKDIR /agent
RUN apt-get update && apt-get install -y openssl && rm -rf /var/lib/apt/lists/*
# minimal package.json
RUN cat <<EOF > package.json
{
"name": "elizaos-agent",
"version": "1.0.0",
"type": "module",
"scripts": {
"build": "tsc",
"start": "node run-all-agents.js"
},
"dependencies": {
"@elizaos/core": "^0.25.9",
"fastembed": "^1.14.4",
"@anush008/tokenizers-linux-x64-gnu": "^0.2.0"
},
"devDependencies": {
"typescript": "^5.8.3"
}
}
EOF
# minimal tsconfig.json
RUN cat <<EOF > tsconfig.json
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "node",
"esModuleInterop": true,
"strict": true,
"skipLibCheck": true,
"outDir": "dist",
"rootDir": "agents"
},
"include": [
"agents/**/*"
],
"exclude": [
"node_modules",
"dist"
]
}
EOF
RUN npm install
# Copy only agent code
COPY ./client/agents ./agents
# Copy the run-all-agents script
COPY run-all-agents.js ./
RUN npm run build
# Prune devDependencies to shrink node_modules
RUN npm prune --production && npm cache clean --force
# ---- Production Stage ----
FROM node:20-slim AS runner
WORKDIR /agent
ENV NODE_ENV=production
COPY --from=builder /agent/node_modules ./node_modules
COPY --from=builder /agent/package.json ./
COPY --from=builder /agent/dist ./dist
COPY --from=builder /agent/run-all-agents.js ./
EXPOSE 4000
CMD ["npm", "start"]