Slim 4 Set Environment

In slim 3 I managed to call a route via cmd php cron.php I recreated an Environment::mock flame to create a route for the file via cli.

On the slim 4 how do I set this variable, because on the slim 3 all settings were via the container

reference slim 3 https://www.slimframework.com/docs/v3/cookbook/environment.html

$env = \Slim\Psr7\Environment::mock([
        'REQUEST_URI' => '/' . pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_FILENAME),
        'HTTP_HOST' => getenv("HTTP_HOST"),
        'HTTPS' => getenv("HTTPS")
    ]);

$container['environment'] = $env;