Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
fabio-ivona committed Jan 21, 2025
1 parent c583df9 commit f7cd5c6
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions app/Containers/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Illuminate\Support\Stringable;

abstract class Container
{
Expand All @@ -34,19 +35,19 @@ abstract class Container
public function __construct()
{
if (empty($this->service_name)) {
throw new ContainerException("Service name missing for image " . static::class);
throw new ContainerException("Service name missing for image ".static::class);
}

if (empty($this->service_definition)) {
throw new ContainerException("Service definition missing for image " . static::class);
throw new ContainerException("Service definition missing for image ".static::class);
}

}

/**
* Returns this service name
*
* @param null $new_service_name
* @param null $new_service_name
*
* @return string
*/
Expand Down Expand Up @@ -76,7 +77,7 @@ public function add_network($name)
/**
* Set Container user
*
* @param string|null $user (default value current_user_id:current_group_id
* @param string|null $user (default value current_user_id:current_group_id
*
* @return Container
*/
Expand All @@ -95,8 +96,8 @@ public function set_user_uid(string $user = null): Container
/**
* Map an host port to container port
*
* @param int $external Port on host system
* @param int $internal Port on container (default = $esternal)
* @param int $external Port on host system
* @param int $internal Port on container (default = $esternal)
*
* @return Container
*/
Expand Down Expand Up @@ -146,7 +147,7 @@ public function set_environment($key, $value, $associative_array = true)
/**
* Set container dependency
*
* @param string $service_name
* @param string $service_name
*
* @return $this
*/
Expand All @@ -160,8 +161,8 @@ public function depends_on(string $service_name)
/**
* Retrieve and environment value from the container
*
* @param string $key
* @param string|null $default
* @param string $key
* @param string|null $default
*
* @return string
*/
Expand Down Expand Up @@ -265,7 +266,9 @@ public function run(TerminalService $terminal, array $commands, string $input =
{

$service_command = [
env('DOCKER_COMPOSE_COMMAND', 'docker compose'),
...((new Stringable(env('DOCKER_COMPOSE_COMMAND', 'docker compose')))
->explode(' ')
->toArray()),
'run',
'--service-ports',
'--rm',
Expand All @@ -285,7 +288,9 @@ public function run(TerminalService $terminal, array $commands, string $input =
public function execute_in_shell_command_line(TerminalService $terminal, array $commands)
{
$service_command = [
env('DOCKER_COMPOSE_COMMAND', 'docker compose'),
...((new Stringable(env('DOCKER_COMPOSE_COMMAND', 'docker compose')))
->explode(' ')
->toArray()),
'exec',
$this->service_name(),
];
Expand Down

0 comments on commit f7cd5c6

Please sign in to comment.