Container: - Dockerfile: python:3.12-slim with stockfish + tmux apt; src copied before pip install -e so the editable wheel actually finds ai_chess. fetch-vendor.sh runs at build time so the image is self-contained. - docker-compose.yml: two networks (default + caddy-network), alias 'chessai' on caddy-network, AI_CHESS_HOST=0.0.0.0 env so uvicorn listens on all interfaces (Caddy reverse-proxies over the network), volumes for games/, logs/, config/ to persist across rebuilds. - __main__.py reads AI_CHESS_HOST + AI_CHESS_PORT from env (falls back to 127.0.0.1:7833 for local dev). - .dockerignore excludes .git, .venv, runtime dirs, screenshots. - deploy/chess.danosito.com.caddy: site snippet, imports header_common, reverse_proxy chessai:7833. Live game UX fixes that landed alongside the deploy: - Snap viewPly to null on every move event so an accidental history-scrub no longer leaves the board locked; previously the only way out was a hard refresh. - movable.events.after wired in chessground constructor (instead of top-level events.move) so user moves are submitted only when they pass chessground's own legality check. - Hide stockfish entirely in human-vs-AI: no eval bar, no best-move arrow, no pv string. AI-vs-AI keeps the full spectator HUD. Coordinator / tmux: - New-game rebuilds the 'chess' tmux session from scratch so pane-agent.sh picks up the new bindings (different agent on a side / human side) instead of running with stale state. - /api/dispatch-first now queues the dispatch in a background task and sleeps 12 s first to let claude/codex finish booting inside the panes — paste-buffer was landing on a still-booting bash before.
40 lines
1.1 KiB
Docker
40 lines
1.1 KiB
Docker
# syntax=docker/dockerfile:1.7
|
|
FROM python:3.12-slim AS base
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
PIP_DISABLE_PIP_VERSION_CHECK=1
|
|
|
|
# Runtime deps: stockfish for eval, tmux for the agent panes, curl for the
|
|
# in-container vendor fetch step.
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
stockfish \
|
|
tmux \
|
|
curl \
|
|
ca-certificates \
|
|
procps \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy everything first — pip install -e needs src/ai_chess to exist at
|
|
# build time so the editable wheel can find the package.
|
|
COPY pyproject.toml README.md ./
|
|
COPY src ./src
|
|
COPY public ./public
|
|
COPY scripts ./scripts
|
|
COPY docs ./docs
|
|
|
|
# Python deps (editable install of the project itself + dev tools)
|
|
RUN pip install hatchling \
|
|
&& pip install -e ".[dev]"
|
|
|
|
# Vendor JS/CSS at build time so the container is fully self-contained.
|
|
RUN chmod +x scripts/*.sh && ./scripts/fetch-vendor.sh
|
|
|
|
# Runtime artefacts (games/, logs/, config/) — keep as named mountable dirs.
|
|
RUN mkdir -p games logs config
|
|
|
|
EXPOSE 7833
|
|
CMD ["python", "-m", "ai_chess"]
|