Files
claude-code/files/Dockerfile.session
T
claude 1bd0fec23a
Helm Chart Release / release-chart (push) Successful in 12s
Build Session Image / build-push (push) Successful in 2m15s
feat: Alpine ベースの Claude Code リモート実行 Helm チャート初版 (v2.1.259)
gateway(nginx) + manager(python 標準ライブラリ) + セッションごとの使い捨て Pod +
reaper CronJob の構成。ブラウザ(PC/スマホ)からアクセスし、セッション単位で
独立した Alpine コンテナに Git リポジトリ(GitHub/Gitea など)をチェックアウトして
編集・検証・プッシュする。無操作が続いたセッションは Pod ごと自動破棄。

- セキュリティ: セッション NS 分離 / restricted PodSecurity / RBAC はセッション NS の
  pods,services のみの Role / セッション Pod は SA トークン非マウント・非 root・
  readOnlyRootFilesystem・drop ALL caps・seccomp / NetworkPolicy で egress を
  DNS+HTTPS+SSH に限定 / Git ホスト allow-list / ResourceQuota+LimitRange
- ライフサイクル: idleTimeout(Pod 内ウォッチドッグ + manager 回収) / maxLifetime
  (activeDeadlineSeconds) / maxSessions / 予備の孤児掃除 CronJob
- 認証: token(既定) / basic / forward(外部SSO) / none。WebSocket は Cookie トークン
- Claude 認証: ANTHROPIC_API_KEY または CLAUDE_CODE_OAUTH_TOKEN
- CI: helm-release.yaml(未リリース版のみ tag+release+publish) /
  image-update-and-release.yaml(週次 npm 追従) / session-image.yaml(multi-arch build)
- files/ 実体を .Files.Get で ConfigMap 化。helm lint / template 検証済み
2026-09-03 08:10:12 +09:00

38 lines
1.6 KiB
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.
# ==========================================================================
# claude-code セッションイメージ(事前ビルド版・推奨)
#
# 既定の values.image.session(node:22-alpine + ブート時インストール)でも
# 動作するが、初回起動が遅い。このイメージを CI でビルド・publish し
# values.image.session に指定すると、セッションのコールドスタートが数秒に短縮される。
#
# ビルド:
# docker buildx build --platform linux/amd64,linux/arm64 \
# --build-arg CLAUDE_CODE_VERSION=2.1.259 \
# -f files/Dockerfile.session \
# -t git.cafepieters.com/helmchart/claude-code/session:2.1.259 --push .
# ==========================================================================
ARG NODE_VERSION=22-alpine
FROM node:${NODE_VERSION}
ARG CLAUDE_CODE_VERSION=""
# git(SSH 込み) / ttyd / bash / 基本ツール。community に ttyd がある。
RUN apk add --no-cache \
bash git openssh-client ca-certificates curl jq less tini \
ttyd \
&& update-ca-certificates
# Claude Code CLI をグローバル導入(ビルド時のみ root、実行時は read-only でOK)
RUN npm install -g --no-fund --no-audit \
"@anthropic-ai/claude-code${CLAUDE_CODE_VERSION:+@${CLAUDE_CODE_VERSION}}" \
&& npm cache clean --force
# 非 root 実行ユーザー(Helm 側の runAsUser と一致させる: 既定 10001)
ARG RUN_UID=10001
RUN adduser -D -u ${RUN_UID} -h /home/claude claude
USER ${RUN_UID}
ENV HOME=/home/claude
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/bin/sh", "/bootstrap/entrypoint.sh"]