fix: docsgpt up removes Caddy when leaving a domain; clearer Docker permission error

Caddy sits behind the https profile, so once COMPOSE_PROFILES no longer
enables it, `up --remove-orphans` left it running on ports 80 and 443 and
`down -v` left its volumes. `up` now removes Caddy when an install moves
off its domain, and down and uninstall name the profile explicitly.

A user outside the docker group was told Docker is not running; the error
now says how to get access to the socket.
This commit is contained in:
Alex committed 2026-09-15 23:06:27 +01:00
1 parent 68d9772f2e
commit 0bd0afc1f8
4 files changed
+52 -14

No files matched your search

+7 -1
View File
@@ -59,7 +59,13 @@ class Docker:
"""Make sure Docker is installed and running and Compose is new enough, starting Docker Desktop on macOS."""
if not self._which("docker"):
raise DeployError("Docker is not installed. Get it from https://docs.docker.com/get-docker/ and run this again.")
if not self.daemon_running():
info = self._run(["docker", "info"], capture=True, check=False)
if info.returncode != 0:
if "permission denied" in (info.stderr or "").lower():
raise DeployError(
"Your user cannot use Docker (permission denied on its socket). Add it to the docker group "
"with `sudo usermod -aG docker $USER`, log out and back in, and run this again."
)
self._start_daemon()
result = self._run(["docker", "compose", "version", "--short"], capture=True, check=False)
version = _parse_version(result.stdout) if result.returncode == 0 else None