|
|
|
|
|
by jsunderland323
78 days ago
|
|
I have waited 12 hours for someone to ask this! You are my hero. So the name "hot" is a bit misleading. The containers don't actually stay alive through the switch. What happens is we do the umount -l /workspace, mount --bind, mount --make-rshared sequence first, and then we run docker compose up --force-recreate. Force-recreate skips compose down (which would tear down the network, named volumes, everything) and just swaps the container processes in place. The old containers and their file watchers are killed and new ones start up. By the time the new container processes start, /workspace already points at the new worktree so all their file handles are fresh and correct. There's no window where a watcher could be writing to stale paths because the old processes are just gone. I was pretty afraid of this at first too but it turns out the force-recreate sidesteps the whole problem. |
|