'docker compose down' removes caddy_cf and the default network, which intermittently severs the SSH session's own network path before 'up' restores it (remote command exited without exit status). Replace with 'pull && up -d --force-recreate --remove-orphans' so the stack is reconciled in place without tearing the network out from under the connection, while still picking up the new :latest image.