forked from FoundationAgents/OpenManus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (43 loc) · 1.75 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (43 loc) · 1.75 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
# 使用官方 Python 3.12 镜像作为基础镜像
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/python:3.12-slim
# 设置工作目录
WORKDIR /app
# 设置环境变量
ENV LANG=zh_CN.UTF-8
ENV LANGUAGE=zh_CN:zh
ENV LC_ALL=zh_CN.UTF-8
# 配置阿里云镜像源
RUN rm -rf /etc/apt/sources.list.d/* && \
echo "deb https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib" > /etc/apt/sources.list && \
echo "deb https://mirrors.aliyun.com/debian-security/ bookworm-security main" >> /etc/apt/sources.list && \
echo "deb https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib" >> /etc/apt/sources.list && \
echo "deb https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib" >> /etc/apt/sources.list
# 安装系统依赖、git、中文语言包和 Playwright 依赖
RUN apt-get update && apt-get install -y \
git \
locales \
wget \
xvfb \
libgbm1 \
libnss3 \
libxss1 \
libasound2 \
libxrandr2 \
libx11-xcb1 \
libxcb-dri3-0 \
libdrm2 \
libglib2.0-0 \
libxkbcommon0 \
libxcomposite1 \
libxdamage1 \
libxfixes3 \
&& rm -r /var/lib/apt/lists/* \
&& localedef -i zh_CN -c -f UTF-8 -A /usr/share/locale/locale.alias zh_CN.UTF-8
# 克隆 OpenManus 仓库, 只依赖里面的requirements.txt来安装依赖, 强烈建议实际运行时用实际代码来覆盖
RUN git clone https://github.com/BCeZn/OpenManus.git .
# 使用阿里云 PyPI 镜像源安装 Python 依赖
RUN pip install --no-cache-dir -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
# 安装 Playwright 并下载浏览器
RUN playwright install && playwright install-deps
# 启动命令
CMD ["python", "main.py"]