File size: 1,428 Bytes
4d4575d
ea5280a
a85e6eb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4d4575d
 
a85e6eb
4cb052e
a85e6eb
 
 
 
 
 
 
 
 
 
ea5280a
 
79e09e1
ea5280a
 
 
 
79e09e1
323a7fe
7243ad9
 
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
FROM node:22-bookworm

# Install Bun (required for build scripts)
RUN curl -fsSL https://bun.sh/install | bash
ENV PATH="/root/.bun/bin:${PATH}"

# 启用 pnpm
RUN corepack enable

WORKDIR /app

ARG CLAWDBOT_DOCKER_APT_PACKAGES=""
RUN if [ -n "$CLAWDBOT_DOCKER_APT_PACKAGES" ]; then \
      apt-get update && \
      DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends $CLAWDBOT_DOCKER_APT_PACKAGES && \
      apt-get clean && \
      rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*; \
    fi

# 安装 git(用于克隆仓库)
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends git && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

RUN npm i -g clawdbot

# 克隆源码
RUN git clone https://github.com/moltbot/moltbot.git ./

# 安装依赖并构建
RUN pnpm install --frozen-lockfile
RUN pnpm build

# Force pnpm for UI build (Bun may fail on ARM/Synology architectures)
ENV CLAWDBOT_PREFER_PNPM=1
RUN pnpm ui:install
RUN pnpm ui:build

# 设置生产环境
ENV NODE_ENV=production
ENV GATEWAY__CONTROLUI__ALLOWINSECUREAUTH=true

# 暴露默认端口(根据项目文档为 8888)
EXPOSE 18789

#CMD ["node","dist/index.js"]
CMD ["node","dist/index.js","gateway","--bind","lan","--port","18789","--allow-unconfigured","--auth","token","--token","3f9dce3b44fbb40e1bba6dd0d5d302361a01e63bc0d40982","--password","admin123"]