浏览代码

Merged in FD3-683 (pull request #38)

Agregado de la configuracion del phpmyadmin

Approved-by: Guillermo Espinoza <guillermo@interlink.com.ar>
Gabriel Gosparo 6 年之前
父节点
当前提交
2d00303e12
共有 1 个文件被更改,包括 14 次插入7 次删除
  1. 14 7
      tools/src/Release.php

+ 14 - 7
tools/src/Release.php

@@ -190,7 +190,9 @@ class Release extends Command
             "pma" => array(
                 'HOST_ENV' => true,
                 "VAR_ENV" => array(
-                    'VIRTUAL_HOST' => '',
+                    "PMA_HOST"=> "mysql",
+                    "PMA_PORT"=> "3306",
+                    "PMA_ABSOLUTE_URI"=> ""
                 ),
                 'OAUTH' => false,
                 'MODULE_INSTALL' => false
@@ -659,6 +661,7 @@ class Release extends Command
             ->addVolumes("./dhcp/", "/opt/dhcp")
             ->addVolumes("./grafana/", "/opt/grafana")
             ->addVolumes("/var/run/docker.sock", "/tmp/docker.sock:ro")
+            ->addVolumes("pma_volumen", "/opt/pma")
             ->addVolumes("./extra/nginx/certs", "/etc/nginx/certs:ro")
             ->addVolumes("./extra/nginx/conf.d", "/etc/nginx/conf.d")
             ->addVolumes("./extra/nginx/share", "/usr/share/nginx/html");
@@ -807,17 +810,18 @@ class Release extends Command
     function addPma(FileFormat2 $composer, $config = array())
     {
         $module = "pma";
-        $host_env_file = "";
+        $host_env_file = "host.env";
         extract($config);
 
         $composer
             ->addService("pma")
             ->image("phpmyadmin/phpmyadmin")
             ->restart($this->_docker_restart_default)
-            ->addPorts(8080, 80)
-            ->addLinks("mysql", "db")
+            ->addLinks("mysql", "mysql")
+            ->addEnv_file("host.env")
             ->addEnv_file("mysql." . $host_env_file)
-            ->addEnv_file($module . "." . $host_env_file);
+            ->addEnv_file($module . "." . $host_env_file)
+            ->addVolumes("pma_volumen", "/www");
 
         $this->writeVariablesEnviroment($module . "." . $host_env_file, $module);
     }
@@ -1085,7 +1089,7 @@ class Release extends Command
     function getDockerComposer($version = "latest", $host_env_file = "host.env", $registry = "docker.infra.flowdat.com/")
     {
         $composer = new FileFormat2("../");
-
+        $composer->getVolumes()->addVolumen('pma_volumen', 'local');
         $base_vars = array(
             "version" => $version,
             "host_env_file" => $host_env_file,
@@ -1107,6 +1111,7 @@ class Release extends Command
         /* Servicios */
         /**************************************************************************************/
         $this->addMySql($composer, $base_vars);
+        $this->addPma($composer, $base_vars);
         $composer
             ->addService("amqp")
             ->build("./extra/amqp/")
@@ -1209,7 +1214,9 @@ class Release extends Command
                     foreach ($app['VAR_ENV'] as $key => $value) {
                         if ($key == 'VIRTUAL_HOST') {
                             $env .= "VIRTUAL_HOST=" . $this->getDomain($module) . "\n";
-                        } else {
+                        } else if($key == 'PMA_ABSOLUTE_URI') {
+                            $env .= "PMA_ABSOLUTE_URI=" . $this->getDomain("pma") . "\n";
+                        }else{
                             $env .= $key . "=" . $value . "\n";
                         }
                     }