|
@@ -245,9 +245,6 @@ inventory=inventory.ini
|
|
|
->addEnviroment("HOST_STATS", "stats.".$domain)
|
|
|
->addEnviroment("HOST_MAPAS", "mapas.".$domain)
|
|
|
->addEnviroment("HOST_BASE", "base.".$domain)
|
|
|
- //->addEnviroment("OAUTH_CLIENT_ID", $oauth_client)
|
|
|
- //->addEnviroment("OAUTH_CLIENT_SECRET", $oauth_client_secret)
|
|
|
- //->addEnviroment("HTTPS_METHOD", "nohttps")
|
|
|
|
|
|
->addVolumes("./mapas/", "/opt/mapas")
|
|
|
->addVolumes("./mapas/web/uploads", "/opt/mapas/web/uploads")
|
|
@@ -271,8 +268,6 @@ inventory=inventory.ini
|
|
|
->addVolumes("./extra/nginx/vhost.d", "/etc/nginx/vhost.d")
|
|
|
->addVolumes("./extra/nginx/share", "/usr/share/nginx/html")
|
|
|
;
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
function addMongDb($composer, $config = array(), $flavor = "dev"){
|
|
@@ -344,10 +339,92 @@ inventory=inventory.ini
|
|
|
->addEnviroment("GF_AUTH_ANONYMOUS_ORG_ROLE", "Viewer")
|
|
|
->addEnviroment("GF_AUTH_ANONYMOUS_ENABLED", "true")
|
|
|
->addEnviroment("GF_DATABASE_URL", "mysql://root:".$mysql_root_pass."@mysql:3306/grafana")
|
|
|
- ->addEnviroment("GF_SERVER_ROOT_URL", "http://grafana.".$fd_domain."/")
|
|
|
+ ->addEnviroment("GF_SERVER_ROOT_URL", "http://grafana.".$domain."/")
|
|
|
;
|
|
|
}
|
|
|
|
|
|
+ function addJsonEndPoints($composer, $config = array(), $flavor = "dev"){
|
|
|
+
|
|
|
+ $version = "latest";
|
|
|
+ $domain = "fd3.flowdat.com";
|
|
|
+ extract($config);
|
|
|
+
|
|
|
+ $composer->addService("statsd")->build("./extra/statsd/statsd")
|
|
|
+ ->image($registry."fd3/statsd:$version")
|
|
|
+ ->addPorts("8125", "8125/udp")
|
|
|
+ ->addLinks("mysql")
|
|
|
+ ->addLinks("mongodb")
|
|
|
+ ->restart("always")
|
|
|
+ ->addVolumes("./extra/statsd/statsd/statsd.config.js", "/opt/config/statsd.config.js")
|
|
|
+ ;
|
|
|
+
|
|
|
+ $composer->addService("jsendpoint")
|
|
|
+ ->build("./extra/statsd/endpoint/json")
|
|
|
+ ->image($registry."fd3/jsonep:$version")
|
|
|
+ ->addVolumes("./extra/statsd/endpoint/json", "/opt/datasource")
|
|
|
+ ->addLinks("jsonep_mysql")
|
|
|
+ ->addLinks("jsonep_mongo")
|
|
|
+ ->restart("always")
|
|
|
+ ;
|
|
|
+
|
|
|
+ $composer->addService("jsonep_mysql")
|
|
|
+ ->build("./extra/statsd/endpoint/mysql")
|
|
|
+ ->image($registry."fd3/jsonep_mysql:$version")
|
|
|
+ ->addVolumes("./extra/statsd/endpoint/mysql", "/opt/datasource")
|
|
|
+ ->addLinks("mysql")
|
|
|
+ ->addEnviroment("MYSQL_ROOT_PASSWORD", $mysql_root_pass)
|
|
|
+ ->restart("always")
|
|
|
+ ;
|
|
|
+
|
|
|
+ $composer->addService("jsonep_mongo")
|
|
|
+ ->build("./extra/statsd/endpoint/mongodb")
|
|
|
+ ->image($registry."fd3/jsonep_mongo:$version")
|
|
|
+ ->addVolumes("./extra/statsd/endpoint/mongodb", "/opt/datasource")
|
|
|
+ ->addLinks("mongodb")
|
|
|
+ ->restart("always")
|
|
|
+ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ function addCommandWorkers($composer, $config = array(), $flavor = "dev"){
|
|
|
+ $version = "latest";
|
|
|
+ $domain = "fd3.flowdat.com";
|
|
|
+ extract($config);
|
|
|
+
|
|
|
+ $composer->addService("ftth_command_worker")->image($registry."fd3/ftth:" . $version)
|
|
|
+ ->build("./ftth/")
|
|
|
+ ->command("bin/console rabbitmq:consumer command_consumer")
|
|
|
+ ->restart("always")
|
|
|
+ ->addLinks("mysql")
|
|
|
+ ->addLinks("base")
|
|
|
+ ->addLinks("amqp")
|
|
|
+ ->addLinks("nginx", "base.".$domain)
|
|
|
+ ->addVolumes("./ftth/", "/opt/ftth")
|
|
|
+ ;
|
|
|
+
|
|
|
+ $composer->addService("ftth_tasklogger_worker")->image($registry."fd3/ftth:" . $version)
|
|
|
+ ->build("./ftth/")
|
|
|
+ ->command("bin/console rabbitmq:consumer flowdat_tasklogger")
|
|
|
+ ->restart("always")
|
|
|
+ ->addLinks("mysql")
|
|
|
+ ->addLinks("base")
|
|
|
+ ->addLinks("amqp")
|
|
|
+ ->addLinks("nginx", "base.".$domain)
|
|
|
+ ->addVolumes("./ftth/", "/opt/ftth")
|
|
|
+ ;
|
|
|
+
|
|
|
+ $composer->addService("stats_command_worker")->image($registry."fd3/ftth:" . $version)
|
|
|
+ ->build("./stats/")
|
|
|
+ ->command("bin/console rabbitmq:consumer command_consumer")
|
|
|
+ ->restart("always")
|
|
|
+ ->addLinks("mysql")
|
|
|
+ ->addLinks("base")
|
|
|
+ ->addLinks("amqp")
|
|
|
+ ->addLinks("nginx", "base.".$domain)
|
|
|
+ ->addVolumes("./stats/", "/opt/stats")
|
|
|
+ ;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
function getDockerComposer( $version = "latest", $host_env_file = "host.env", $registry = "docker.infra.flowdat.com/", $fd_domain = "fd3.flowdat.com")
|
|
|
{
|
|
|
|
|
@@ -395,8 +472,12 @@ $oauth_client_secret = "5w7gx6ptdoo4g8cwwo88o8gowosgco84sso08ssow0osg88g8k";
|
|
|
$this->addGrafana($composer, $base_vars + array(
|
|
|
'mysql_user' => $mysql_user,
|
|
|
'mysql_pass' => $mysql_pass,
|
|
|
+ 'mysql_root_pass' => $mysql_root_pass,
|
|
|
));
|
|
|
|
|
|
+ $this->addJsonEndPoints$composer, $base_vars + array(
|
|
|
+ 'mysql_root_pass' => $mysql_root_pass,
|
|
|
+ ));
|
|
|
|
|
|
|
|
|
/**************************************************************************************/
|
|
@@ -405,26 +486,7 @@ $oauth_client_secret = "5w7gx6ptdoo4g8cwwo88o8gowosgco84sso08ssow0osg88g8k";
|
|
|
|
|
|
$this->addSupervisord($composer, $base_vars);
|
|
|
|
|
|
- //$composer->addService("ftth_worker")->image($registry."fd3/ftth:" . $v)
|
|
|
- // ->build("./ftth/")
|
|
|
- // ->restart("always")
|
|
|
- // ->addLinks("mysql")
|
|
|
- // ->addLinks("base")
|
|
|
- // ->addLinks("amqp")
|
|
|
- // ->addLinks("base", "base.".$fd_domain)
|
|
|
-
|
|
|
-
|
|
|
- // ->addEnviroment("VIRTUAL_HOST", "ftth.".$fd_domain)
|
|
|
- // ->addEnviroment("HTTPS_METHOD", "nohttps")
|
|
|
- // ->addEnviroment("HOST_FTTH", "ftth.".$fd_domain)
|
|
|
- // ->addEnviroment("HOST_STATS", "stats.".$fd_domain)
|
|
|
- // ->addEnviroment("HOST_MAPAS", "mapas.".$fd_domain)
|
|
|
- // ->addEnviroment("HOST_BASE", "base.".$fd_domain)
|
|
|
- // //->addEnviroment("OAUTH_CLIENT_ID", $oauth_client)
|
|
|
- // //->addEnviroment("OAUTH_CLIENT_SECRET", $oauth_client_secret)
|
|
|
-
|
|
|
- // ->addVolumes("./ftth/", "/opt/ftth")
|
|
|
- //;
|
|
|
+ $this->addCommandWorkers($composer, $base_vars);
|
|
|
|
|
|
|
|
|
//$composer->addService("phpmyadmin")->image("phpmyadmin/phpmyadmin")
|
|
@@ -437,43 +499,6 @@ $oauth_client_secret = "5w7gx6ptdoo4g8cwwo88o8gowosgco84sso08ssow0osg88g8k";
|
|
|
// ->addEnviroment("HTTPS_METHOD", "nohttps")
|
|
|
//;
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- //$composer->addService("jsendpoint")
|
|
|
- // ->build("./extra/statsd/endpoint/json")
|
|
|
- // ->image($registry."fd3/jsonep:$v")
|
|
|
- // ->addVolumes("./extra/statsd/endpoint/json", "/opt/datasource")
|
|
|
- // ->addLinks("jsonep_mysql")
|
|
|
- // ->addLinks("jsonep_mongo")
|
|
|
- // ->restart("always")
|
|
|
- // ;
|
|
|
-
|
|
|
- //$composer->addService("jsonep_mysql")
|
|
|
- // ->build("./extra/statsd/endpoint/mysql")
|
|
|
- // ->image($registry."fd3/jsonep_mysql:$v")
|
|
|
- // ->addVolumes("./extra/statsd/endpoint/mysql", "/opt/datasource")
|
|
|
- // ->addLinks("mysql")
|
|
|
- // ->addEnviroment("MYSQL_ROOT_PASSWORD", $mysql_root_pass)
|
|
|
- // ->restart("always")
|
|
|
- // ;
|
|
|
-
|
|
|
- //$composer->addService("jsonep_mongo")
|
|
|
- // ->build("./extra/statsd/endpoint/mongodb")
|
|
|
- // ->image($registry."fd3/jsonep_mongo:$v")
|
|
|
- // ->addVolumes("./extra/statsd/endpoint/mongodb", "/opt/datasource")
|
|
|
- // ->addLinks("mongodb")
|
|
|
- // ->restart("always")
|
|
|
- // ;
|
|
|
-
|
|
|
- //$composer->addService("statsd")->build("./extra/statsd/statsd")
|
|
|
- // ->image($registry."fd3/statsd:$v")
|
|
|
- // ->addPorts("8125", "8125/udp")
|
|
|
- // ->addLinks("mysql")
|
|
|
- // ->addLinks("mongodb")
|
|
|
- // ->restart("always")
|
|
|
- // ->addVolumes("./extra/statsd/statsd/statsd.config.js", "/opt/config/statsd.config.js")
|
|
|
- //;
|
|
|
-
|
|
|
|
|
|
return $composer->render();
|
|
|
}
|