-
Notifications
You must be signed in to change notification settings - Fork 503
Expand file tree
/
Copy pathDockerfile
More file actions
75 lines (59 loc) · 2.08 KB
/
Dockerfile
File metadata and controls
75 lines (59 loc) · 2.08 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
75
FROM node:20-slim AS builder
# Install build dependencies for better-sqlite3 native module
RUN apt-get update && apt-get install -y \
python3 \
make \
g++ \
git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install dependencies
COPY package.json ./
COPY packages/core/package.json packages/core/
COPY packages/main/package.json packages/main/
COPY packages/server/package.json packages/server/
COPY packages/teams/package.json packages/teams/
COPY packages/channels/package.json packages/channels/
COPY packages/cli/package.json packages/cli/
COPY packages/visualizer/package.json packages/visualizer/
ENV PUPPETEER_SKIP_DOWNLOAD=true
RUN npm install
# Copy source and build
COPY tsconfig.json tsconfig.base.json ./
COPY packages/ packages/
COPY .agents/ .agents/
COPY AGENTS.md heartbeat.md SOUL.md ./
RUN npm run build
# Prune dev dependencies
RUN npm prune --omit=dev
# --- Production stage ---
FROM node:20-slim
# Install runtime dependencies:
# chromium - for WhatsApp (Puppeteer) and agent-browser (Playwright)
# git - for agent CLIs
RUN apt-get update && apt-get install -y \
git \
chromium \
&& rm -rf /var/lib/apt/lists/*
# Point Puppeteer (whatsapp-web.js) at system Chromium
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
# Install AI CLIs and browser automation globally
RUN npm install -g @anthropic-ai/claude-code @openai/codex agent-browser 2>/dev/null || true
# Install Playwright browsers (shares OS deps with system Chromium)
RUN npx playwright install chromium 2>/dev/null || true
WORKDIR /app
# Copy built app from builder
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/packages ./packages
COPY --from=builder /app/package.json ./
COPY --from=builder /app/tsconfig.base.json ./
COPY --from=builder /app/.agents ./.agents
COPY --from=builder /app/AGENTS.md /app/heartbeat.md /app/SOUL.md ./
# Persistent data directory
RUN mkdir -p /root/.tinyagi /root/workspace
ENV TINYAGI_HOME=/root/.tinyagi
ENV NODE_ENV=production
ENV TINYAGI_API_PORT=3777
EXPOSE 3777
COPY docker-entrypoint.sh ./
ENTRYPOINT ["./docker-entrypoint.sh"]