fix(proxy): daemon-style claude container — survives without TTY
Some checks failed
CI / lint (push) Successful in 39s
Deploy / notebooks (push) Has been skipped
Deploy / zotero (push) Has been skipped
Deploy / docs (push) Has been skipped
Deploy / api (push) Has been skipped
Deploy / mc (push) Has been skipped
Deploy / report (push) Successful in 15s
CI / test (push) Failing after 13m2s
Package Supply Chain / pkg-supply-chain (push) Failing after 58s

ENTRYPOINT was claude, so the container's life was tied to a single
claude invocation. docker compose up (no attached TTY) → claude exits
immediately → container dies. Only docker compose run --rm with an
attached terminal kept it alive, which doesn't match how the sandbox
is meant to be used.

Now ENTRYPOINT is sleep infinity and compose pins the same. The
container stays up; users do `docker compose exec claude claude` for
interactive or one-shot sessions, or `docker compose run --rm
--entrypoint claude claude` for ephemeral runs.
This commit is contained in:
kert
2026-05-19 11:04:22 -04:00
parent 2bdbdc11b4
commit a94d3d4f96
2 changed files with 14 additions and 6 deletions

View File

@@ -10,4 +10,7 @@ RUN apt-get update \
RUN npm install -g @anthropic-ai/claude-code RUN npm install -g @anthropic-ai/claude-code
ENTRYPOINT ["claude"] # Daemon-style: container stays alive so users `docker compose exec` claude
# inside it. For one-shot invocations: `docker compose run --rm
# --entrypoint claude claude [-p 'prompt']`.
ENTRYPOINT ["sleep", "infinity"]

View File

@@ -17,10 +17,13 @@
# match without poisoning cf-proxy's own DNS view. # match without poisoning cf-proxy's own DNS view.
# #
# Usage: # Usage:
# cp .env.example .env && $EDITOR .env # set PROXY_PASSWORD and # cp .env.example .env && $EDITOR .env # PROXY_PASSWORD and
# CF_ACCESS_CLIENT_ID/SECRET # CF_ACCESS_CLIENT_ID/SECRET
# docker compose run --rm claude # interactive session # docker compose up -d claude # bring up the sandbox
# docker compose run --rm claude -p 'ping' # one-shot # docker compose exec claude claude # interactive session
# docker compose exec claude claude -p 'ping' # one-shot inside the sandbox
# docker compose run --rm --entrypoint claude claude [-p 'ping']
# # ephemeral one-shot
# #
# Notes: # Notes:
# - claude-home is a named volume so login state persists across runs. # - claude-home is a named volume so login state persists across runs.
@@ -47,6 +50,10 @@ services:
container_name: cc-claude container_name: cc-claude
depends_on: depends_on:
- cf-proxy - cf-proxy
# Long-running so users docker exec into it. claude itself is launched
# per-session via `docker compose exec claude claude`.
entrypoint: ["sleep", "infinity"]
restart: unless-stopped
networks: networks:
- proxy_net - proxy_net
extra_hosts: extra_hosts:
@@ -61,8 +68,6 @@ services:
- /home/care/acoharmony:/home/care/acoharmony - /home/care/acoharmony:/home/care/acoharmony
- /opt/s3/data/workspace:/opt/s3/data/workspace - /opt/s3/data/workspace:/opt/s3/data/workspace
- /opt/s3/data/notebooks:/opt/s3/data/notebooks - /opt/s3/data/notebooks:/opt/s3/data/notebooks
stdin_open: true
tty: true
networks: networks:
proxy_net: proxy_net: