Two issues kept the deployed container from finishing the tmux rebuild: 1. asyncio's subprocess.communicate() blocked forever on `tmux new-session` and `tmux split-window` because the spawned pane child (pane-agent.sh → claude/codex) inherited the wrapper's stdout/stderr pipe fds and kept them open. _run() now uses DEVNULL for stdin/stdout/stderr by default (capture_stdout=True for the lone capture-pane call), and stderr is no longer collected — exit code is enough for upstream. 2. tmux re-indexes panes in layout-traversal order after every split, so the original 'split black off white horizontally, then split log off white vertically' sequence ended with indices 0=white, 1=log, 2=black — but the coordinator's pane_for hardcoded black=1, so prompts to codex landed on the log pane instead. Reorder: split log off the bottom of white FIRST (gives 0=white,1=log), THEN split black off the right of white (now indices 0=white,1=black,2=log, matching the hardcoded map). Plus a small docker-compose change: ~/.codex needs to be writable so codex can persist its history/session state — without rw the CLI exits immediately with 'Read-only file system'.
34 lines
1.1 KiB
YAML
34 lines
1.1 KiB
YAML
services:
|
|
chessai:
|
|
build: .
|
|
image: chessai:latest
|
|
container_name: chessai
|
|
restart: unless-stopped
|
|
environment:
|
|
AI_CHESS_HOST: "0.0.0.0" # listen on all interfaces inside the container
|
|
AI_CHESS_PORT: "7833"
|
|
# claude-code auth — talks to user's machka gateway, no Anthropic
|
|
# subscription needed at runtime.
|
|
ANTHROPIC_BASE_URL: "${ANTHROPIC_BASE_URL:-https://claude.machka.dev}"
|
|
ANTHROPIC_AUTH_TOKEN: "${ANTHROPIC_AUTH_TOKEN}"
|
|
networks:
|
|
default:
|
|
caddy-network:
|
|
aliases:
|
|
- chessai
|
|
volumes:
|
|
# Persistent runtime data — survives container rebuilds.
|
|
- ./games:/app/games
|
|
- ./logs:/app/logs
|
|
- ./config:/app/config
|
|
# codex config + auth lives in /opt/chessai/secrets/codex on the host
|
|
# and is mapped into the container's $CODEX_HOME (= ~/.codex by default).
|
|
# codex writes its own session/history/logs inside ~/.codex, so the
|
|
# mount has to be rw — the auth.json itself is never rewritten.
|
|
- ./secrets/codex:/home/chess/.codex
|
|
|
|
networks:
|
|
caddy-network:
|
|
external: true
|
|
name: caddy-network
|