forked from cnlimiter/codex-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (30 loc) · 842 Bytes
/
Dockerfile
File metadata and controls
38 lines (30 loc) · 842 Bytes
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
# 使用官方 Python 基础镜像 (使用 slim 版本减小体积)
FROM python:3.11-slim
# 设置工作目录
WORKDIR /app
ARG DEFAULT_WEBUI_PORT=15555
# 设置环境变量
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
# WebUI 默认配置
WEBUI_HOST=0.0.0.0 \
WEBUI_PORT=${DEFAULT_WEBUI_PORT} \
LOG_LEVEL=info \
DEBUG=0
# 安装系统依赖
# (curl_cffi 等库可能需要编译工具)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gcc \
python3-dev \
&& 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
# 复制项目代码
COPY . .
# 暴露端口
EXPOSE ${DEFAULT_WEBUI_PORT}
# 启动 WebUI
CMD ["python", "webui.py"]