Files
coolify/app/Console/Commands/SeedDevelopmentQemuServerCommand.php
T
Andras Bacsai 5f6fb5dcc2 feat(dev): run localhost dev server in a Lima VM on macOS
Add a Lima backend to scripts/dev. Auto mode picks it on macOS when
limactl (Lima >= 2.0) is installed, and COOLIFY_DEV_SERVER_BACKEND=lima
forces it. Lima VMs are named coolify-dev-<slot>-<profile>. Coolify
connects to them through Lima's forwarded SSH port on
host.docker.internal, and only guest ports 80/443 are forwarded to
the host.

dev:qemu:seed now takes --ip and --port options, so the seeded server
can use a forwarded SSH address instead of the profile IP.

Add tests for the Lima start flow and for seeding with an overridden
address, and document the macOS setup in AGENTS.md.
2026-09-28 09:45:29 +02:00

28 lines
1020 B
PHP

<?php
namespace App\Console\Commands;
use App\Actions\Development\SeedDevelopmentQemuServer;
use Illuminate\Console\Command;
class SeedDevelopmentQemuServerCommand extends Command
{
protected $signature = 'dev:qemu:seed {profile : Profile key from config/development-qemu.php} {--keep-others} {--as-localhost : Use the VM for the localhost server (id 0)} {--ip= : SSH host instead of the profile IP} {--port=22 : SSH port}';
protected $description = 'Seed one development QEMU server in the Coolify database';
public function handle(): int
{
if (! isDev()) {
$this->error('This command may only run in development mode.');
return self::FAILURE;
}
$server = SeedDevelopmentQemuServer::run($this->argument('profile'), ! $this->option('keep-others'), (bool) $this->option('as-localhost'), $this->option('ip') ?: null, (int) $this->option('port'));
$this->info("Seeded {$server->name} at {$server->ip}.");
return self::SUCCESS;
}
}