Spaces:
Sleeping
Sleeping
| set -eu | |
| cd /app | |
| puzzle_dir="data/lichess-puzzles/data" | |
| has_puzzles=0 | |
| if [ -d "$puzzle_dir" ]; then | |
| for f in "$puzzle_dir"/train-*.parquet; do | |
| if [ -f "$f" ]; then | |
| has_puzzles=1 | |
| break | |
| fi | |
| done | |
| fi | |
| if [ "$has_puzzles" -eq 0 ]; then | |
| if [ "${DOWNLOAD_PUZZLES:-0}" = "1" ]; then | |
| echo ">>> No local puzzle shards — downloading HF shard 0 (~300 MB)" | |
| python -m chess_tutor.download_lichess_puzzles --shard 0 | |
| else | |
| echo ">>> No puzzle shards in image (puzzle ladders disabled)." | |
| echo " Copy data/lichess-puzzles/ before docker build, or run with DOWNLOAD_PUZZLES=1" | |
| fi | |
| fi | |
| HOST="${HOST:-0.0.0.0}" | |
| PORT="${PORT:-8765}" | |
| echo ">>> Chess Tutor web UI at http://${HOST}:${PORT}/" | |
| exec python -m chess_tutor.web --host "${HOST}" --port "${PORT}" | |