refactor: 简化 Dockerfile 并更新 Codex 配置
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -29,6 +29,8 @@ RUN code-server --install-extension dbaeumer.vscode-eslint &&\
|
|||||||
code-server --install-extension ms-azuretools.vscode-docker &&\
|
code-server --install-extension ms-azuretools.vscode-docker &&\
|
||||||
code-server --install-extension PKief.material-icon-theme &&\
|
code-server --install-extension PKief.material-icon-theme &&\
|
||||||
code-server --install-extension tencent-cloud.coding-copilot &&\
|
code-server --install-extension tencent-cloud.coding-copilot &&\
|
||||||
|
# ✅ 在这里安装 Codex VS Code 插件(不会冲突)
|
||||||
|
code-server --install-extension openai.openai-codex &&\
|
||||||
echo done
|
echo done
|
||||||
|
|
||||||
# install Go Tools
|
# install Go Tools
|
||||||
@@ -40,45 +42,11 @@ RUN go install -v github.com/cweill/gotests/gotests@latest
|
|||||||
RUN go install -v github.com/josharian/impl@latest
|
RUN go install -v github.com/josharian/impl@latest
|
||||||
RUN go install -v github.com/haya14busa/goplay/cmd/goplay@latest
|
RUN go install -v github.com/haya14busa/goplay/cmd/goplay@latest
|
||||||
RUN go install -v github.com/go-delve/delve/cmd/dlv@latest
|
RUN go install -v github.com/go-delve/delve/cmd/dlv@latest
|
||||||
# install goreleaser
|
|
||||||
RUN go install github.com/goreleaser/goreleaser/v2@latest
|
RUN go install github.com/goreleaser/goreleaser/v2@latest
|
||||||
# 安装 Node.js 22(修复旧版node无法安装codex的问题)
|
|
||||||
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg && \
|
|
||||||
echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
|
|
||||||
apt update && \
|
|
||||||
apt install -y nodejs && \
|
|
||||||
npm config set registry https://registry.npmmirror.com/ && \
|
|
||||||
npm install -g @openai/codex && \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# 配置 Codex
|
# 清理无用的 node / npm codex 安装(已全部移除)
|
||||||
RUN mkdir -p /root/.codex
|
RUN rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# 写入 config.toml
|
|
||||||
RUN cat > /root/.codex/config.toml <<'EOF'
|
|
||||||
model_provider = "OpenAI"
|
|
||||||
model = "gpt-5.4"
|
|
||||||
model_reasoning_effort = "high"
|
|
||||||
disable_response_storage = true
|
|
||||||
|
|
||||||
[model_providers.OpenAI]
|
|
||||||
name = "OpenAI"
|
|
||||||
base_url = "https://api.jucode.cn/v1"
|
|
||||||
wire_api = "responses"
|
|
||||||
requires_openai_auth = true
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# 写入 auth.json
|
|
||||||
RUN cat > /root/.codex/auth.json <<'EOF'
|
|
||||||
{
|
|
||||||
"auth_mode": "apikey",
|
|
||||||
"OPENAI_API_KEY": "sk-E0ZZIFNnD0RkhMC9pT2AGMutz9vNy2VLNrgyyobT5voa81pQ"
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# 权限配置
|
|
||||||
RUN chmod 600 /root/.codex/auth.json
|
|
||||||
|
|
||||||
ENV LC_ALL zh_CN.UTF-8
|
ENV LC_ALL zh_CN.UTF-8
|
||||||
ENV LANG zh_CN.UTF-8
|
ENV LANG zh_CN.UTF-8
|
||||||
ENV LANGUAGE zh_CN.UTF-8
|
ENV LANGUAGE zh_CN.UTF-8
|
||||||
|
|||||||
Reference in New Issue
Block a user