<?php

namespace App\Commands;

use App\Services\Command;
use App\Services\Docker;
use Illuminate\Support\Facades\Process;

class Up extends Command
{
    protected $signature = 'up';

    protected $description = 'Start Docker Environment';

    public function handle() : void
    {

        $this->info('Starting Wordpress');

        $upCommand = Docker::base('up -d');

        Process::forever()->run($upCommand, function (string $type, string $output) {
            echo $output;
        });
    }

}
