FROM alpine:latest # 設定安裝用的環境變數 ENV CODEX_NON_INTERACTIVE=1 ENV CODEX_INSTALL_DIR=/usr/local/bin ENV CODEX_HOME=/root/.codex ENV CODEX_PLUGINS="jsc@doc jsc@code-review" # 安裝必要的工具 RUN apk add --no-cache --no-check-certificate bash ca-certificates curl git jq util-linux # 安裝 Codex CLI 工具 RUN install_script="$(mktemp)" \ && curl -fsSL --retry 3 --retry-delay 2 --max-time 120 \ https://chatgpt.com/codex/install.sh \ -o "$install_script" \ && sh "$install_script" \ && rm -f "$install_script" # 安裝技能 RUN codex plugin marketplace add https://gitea.jsc.idv.tw/plugins/doc.git \ && codex plugin marketplace add https://gitea.jsc.idv.tw/plugins/code-review.git \ && for plugin in $CODEX_PLUGINS; do codex plugin add "$plugin"; done COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"]