#!/usr/bin/env bash
# Real demos for P096 "The Django Roadmap for Beginners". Made on the Mac (Docker Desktop).
# Dave builds the potluck sign-up site for his community's potluck, ~/potluck. One container from a stock Ubuntu
# 24.04 image (lab/Dockerfile); Django installed on camera with pip in a virtual environment; two real interactive
# bash windows in ptys (Dave's shell and the development server's log, demo_driver.py); the files Dave writes in his
# editor wait in lab/steps/<stage>/ and are copied in off camera; real browser captures through Playwright.
set -euo pipefail
cd "$(dirname "$0")"
cleanup() { docker rm -f ce-p096-laptop >/dev/null 2>&1 || true; }
cleanup
[ -n "${KEEP:-}" ] || trap cleanup EXIT
docker build -q -t ce-p096 lab >/dev/null
docker run -d --name ce-p096-laptop --hostname laptop -p 127.0.0.1:18096:8001 ce-p096 >/dev/null
python3 demo_driver.py
