forked from dou-jiang/codex-console
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (44 loc) · 1.16 KB
/
Dockerfile
File metadata and controls
51 lines (44 loc) · 1.16 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 基础镜像 (使用 slim 版本减小体积)
FROM python:3.11-slim
# 设置工作目录
WORKDIR /app
# 设置环境变量
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
# WebUI 默认配置
WEBUI_HOST=0.0.0.0 \
WEBUI_PORT=1455 \
DISPLAY=:99 \
ENABLE_VNC=1 \
VNC_PORT=5900 \
NOVNC_PORT=6080 \
LOG_LEVEL=info \
DEBUG=0
# 安装系统依赖
# (curl_cffi 等库可能需要编译工具)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gcc \
python3-dev \
xvfb \
fluxbox \
x11vnc \
websockify \
novnc \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# 复制依赖文件并安装
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt \
&& python -m playwright install --with-deps chromium
# 复制项目代码
COPY . .
COPY scripts/docker/start-webui.sh /app/scripts/docker/start-webui.sh
RUN chmod +x /app/scripts/docker/start-webui.sh
# 暴露端口
EXPOSE 1455
EXPOSE 6080
EXPOSE 5900
# 启动 WebUI
CMD ["/app/scripts/docker/start-webui.sh"]