codex / Dockerfile
webhook's picture
Upload 137 files
89419ea verified
Raw History Blame Contribute Delete
887 Bytes
# 使用官方 Python 基础镜像 (使用 slim 版本减小体积)
FROM python:3.11-slim
# 设置工作目录
WORKDIR /app
# 设置环境变量
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
# WebUI 默认配置
WEBUI_HOST=0.0.0.0 \
WEBUI_PORT=7860 \
LOG_LEVEL=info \
DEBUG=0 \
WEBUI_ACCESS_PASSWORD=admin123
# 安装系统依赖
# (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 7860
# 启动 WebUI
CMD ["python", "webui.py", "--host", "0.0.0.0", "--port", "7860", "--access-password", "admin123"]