File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ Thumbs.db
2626# Env
2727.env
2828.env.local
29+ .env.bak. *
30+ .deploy /
2931USAGE_WINDOW_LOGIC.md
3032.claude /settings.local.json
3133scripts
Original file line number Diff line number Diff line change 9393
9494### 一键交互部署 (推荐)
9595
96- ` deploy.sh ` 提供 6 步交互式向导,依次询问 ** 端口 / 监听范围 / 数据库 / 密钥 / 构建方式 / 确认** ,自动生成 ` .env ` 并拉起容器。
96+ ` deploy.sh ` 提供 7 步交互式向导,依次询问 ** 端口 / 监听范围 / 数据库 / 密钥 / 构建方式 / 更新能力 / 确认** ,会先尝试拉取最新代码,再自动生成 ` .env ` 并拉起容器。
97+
98+ 如果当前目录已有 ` .env ` ,脚本会读取其中的端口、监听地址、数据库、Redis、管理密钥和 API 密钥作为默认值,后续重跑脚本时可直接回车复用原配置。
9799
98100** 场景 1:尚未克隆仓库(一行远程拉起)**
99101
@@ -120,13 +122,24 @@ bash deploy.sh
120122
121123绑定地址会写入 ` .env ` 的 ` BIND_HOST ` ,后续可手动修改后 ` docker compose up -d ` 重启生效。
122124
125+ ** 更新能力选项**
126+
127+ | 选项 | 行为 | 适用场景 |
128+ | --- | --- | --- |
129+ | 1) 不挂载 Docker socket (默认) | 不向容器暴露 Docker API | 更安全,适合普通部署 |
130+ | 2) 启用一键更新 | 生成运行时 compose override 并挂载 ` /var/run/docker.sock:/var/run/docker.sock ` | 需要在管理后台触发 Watchtower 一键更新的可信服务器 |
131+
132+ 该选项仅对拉取镜像部署生效,本地构建模式会自动跳过 Docker socket 挂载。运行时 override 默认写入 ` .deploy/docker-socket.override.yml ` ,` .deploy/ ` 已被 git 忽略,不影响后续拉取最新代码。
133+
123134** 可选环境变量** (用于自定义自举行为)
124135
125136| 变量 | 默认 | 说明 |
126137| --- | --- | --- |
127138| ` CODEX2API_REPO_URL ` | ` https://github.com/james-6-23/codex2api.git ` | 克隆使用的仓库地址 |
128139| ` CODEX2API_REPO_BRANCH ` | ` main ` | 克隆使用的分支 |
129140| ` CODEX2API_DIR_NAME ` | ` codex2api ` | 克隆到本地的目录名 |
141+ | ` CODEX2API_DEPLOY_RUNTIME_DIR ` | ` .deploy ` | 部署脚本生成运行时 compose override 的目录 |
142+ | ` CODEX2API_SKIP_GIT_PULL ` | 空 | 设为 ` 1 ` 或 ` true ` 时跳过部署前自动拉取最新代码 |
130143
131144### 部署模式总览
132145
You can’t perform that action at this time.
0 commit comments