toolsphp / docker
There is no license information available for the latest version (0.2.1) of this package.
0.2.1
2016-10-12 07:06 UTC
Requires
This package is not auto-updated.
Last update: 2024-11-13 20:29:02 UTC
README
- запуск контейнеров из PHP. Восзможное использование в тестах
use ToolsPhp\docker\Composer; use ToolsPhp\docker\containers\DbContainer; use ToolsPhp\docker\Docker;include DIR . "/../vendor/autoload.php";
$docker = Docker::getInstance(); $docker->factory([ 'postgres' => function(Composer $composer) { $composer->setPrototype(DbContainer::class); /** @var DbContainer $container */ $container = $composer->up(DIR . '/docker-composer.yml'); $container->setParamConnect('pgsql', 'postgres','postgres','postgres');
return $container; }
]);
/** @var DbContainer $postgres */ $postgres = $docker->get('postgres'); $postgres->start();
$pdo = $postgres->getPDO();