Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
63 lines (49 loc) · 1.93 KB
/
Copy pathDockerfile
File metadata and controls
63 lines (49 loc) · 1.93 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
# ── Stage 1: Install dependencies (includes native module compilation) ──
FROM node:22-bookworm AS deps
RUN apt-get update && \
apt-get install -y --no-install-recommends python3 make g++ && \
rm -rf /var/lib/apt/lists/*
RUN npm install -g pnpm@11.3.0
WORKDIR /app
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY patches/ ./patches/
RUN pnpm install --frozen-lockfile
# ── Stage 2: Build dashboard UI ──
FROM node:22-bookworm AS ui-build
RUN npm install -g pnpm@11.3.0
WORKDIR /app/src/dashboard/ui
COPY src/dashboard/ui/package.json src/dashboard/ui/pnpm-lock.yaml src/dashboard/ui/pnpm-workspace.yaml ./
RUN pnpm install --frozen-lockfile
COPY src/dashboard/ui/ ./
RUN pnpm run build
# ── Stage 3: Runtime ──
FROM node:22-bookworm
# 预装常用 CLI 工具(供 Agent bash 代码块使用)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ffmpeg zip unzip wget curl jq imagemagick git ca-certificates \
python3 python3-pip python3-venv python3-dev build-essential \
libmagic-dev \
pandoc poppler-utils \
dnsutils \
&& rm -rf /var/lib/apt/lists/*
# 设置 Python 别名
RUN ln -s /usr/bin/python3 /usr/bin/python
# 安装 uv (极速 Python 包管理器) 和 ruff (极速 Linter)
RUN curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR="/usr/local/bin" sh
WORKDIR /app
# Copy compiled node_modules from deps stage
COPY --from=deps /app/node_modules ./node_modules
# Copy source & runtime files
COPY package.json ./
COPY src ./src
COPY system-prompts ./system-prompts
# Copy built dashboard assets from ui-build stage
COPY --from=ui-build /app/src/dashboard/public ./src/dashboard/public
# Data directory (mount as volume for persistence)
RUN mkdir -p /app/workspace
VOLUME /app/workspace
# Agent working directory (downloads, temp files — survives rebuilds)
RUN mkdir -p /app/agent-data
VOLUME /app/agent-data
ENTRYPOINT ["npx", "tsx", "src/main.ts"]