docker4php/docker-compose-config

Provides a service to read, modify and write docker-compose configuration files.

1.0.0 2018-03-26 15:30 UTC

README

pipeline status coverage report

docker4php/docker-compose-config

Provides a service to read, modify and write docker-compose configuration files.

Install

composer require-dev docker4php/docker-compose-config

Usage

<?php 

    $dockerCompose = new Lyska\Docker4Php\DockerCompose\Config();
    
    $dockerCompose->setVersion('2');
    $dockerCompose->setService('php', [
      'image' => 'php:7.1',
      'environment' => [
        'APACHE_DOCUMENT_ROOT' => '/var/www/html/public',
      ],
      'volumes' => [
        './:/var/www/html/public',
      ],
    ]);
    
    $dockerCompose->write('docker-compose.yml');