Files
ai-pull-request/Dockerfile
T

21 lines
670 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
# 複製 Node.js 應用程式
COPY app/ /app/
# 應用程式無第三方相依套件,僅在有 package-lock 時安裝
RUN if [ -f /app/package-lock.json ]; then cd /app && npm ci --omit=dev; fi
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]