Files
ai-pull-request/Dockerfile
T

23 lines
738 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
FROM node:20-bookworm-slim
# 安裝必要工具:git(操作分支/合併)、bash、ca-certificates、curl(安裝 opencode
RUN apt-get update \
&& apt-get install -y --no-install-recommends git bash ca-certificates curl \
&& rm -rf /var/lib/apt/lists/*
# 安裝 opencode CLI(用於分析 git diff 產生 PR 標題與描述)
# 釘住版本以確保建置可重現並降低供應鏈風險
RUN npm install -g opencode-ai@1.17.11
# 複製 Node.js 應用程式
COPY app/ /app/
WORKDIR /app
# 應用程式無第三方相依套件,僅在有 package-lock 時安裝
RUN if [ -f package-lock.json ]; then npm ci --omit=dev; fi
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]