|
@@ -26,12 +26,15 @@ class Release extends Command
|
|
|
->addOption('base-repo',null, InputOption::VALUE_REQUIRED, 'Git clone Url fot the app Base', "git@bitbucket.org:ikflowdat/base.git")
|
|
|
->addOption('base-ref', null, InputOption::VALUE_REQUIRED, 'Git reference (branch or tag) to clone the Base app', "master")
|
|
|
|
|
|
- ->addOption('ftth-repo',null, InputOption::VALUE_REQUIRED, 'Git clone Url fot the app Base', "git@bitbucket.org:ikflowdat/ftth.git")
|
|
|
- ->addOption('ftth-ref', null, InputOption::VALUE_REQUIRED, 'Git reference (branch or tag) to clone the Ftth appFtth', "master")
|
|
|
+ ->addOption('ftth-repo',null, InputOption::VALUE_REQUIRED, 'Git clone Url fot the app FTTH', "git@bitbucket.org:ikflowdat/ftth.git")
|
|
|
+ ->addOption('ftth-ref', null, InputOption::VALUE_REQUIRED, 'Git reference (branch or tag) to clone the Ftth ', "master")
|
|
|
|
|
|
- ->addOption('mapas-repo',null, InputOption::VALUE_REQUIRED, 'Git clone Url fot the app Base', "git@bitbucket.org:ikflowdat/mapas.git")
|
|
|
+ ->addOption('mapas-repo',null, InputOption::VALUE_REQUIRED, 'Git clone Url fot the app Mapas', "git@bitbucket.org:ikflowdat/mapas.git")
|
|
|
->addOption('mapas-ref', null, InputOption::VALUE_REQUIRED, 'Git reference (branch or tag) to clone the Mapas app', "master")
|
|
|
|
|
|
+ ->addOption('radius-repo',null, InputOption::VALUE_REQUIRED, 'Git clone Url fot the app radius', "git@bitbucket.org:ikflowdat/radius.git")
|
|
|
+ ->addOption('radius-ref', null, InputOption::VALUE_REQUIRED, 'Git reference (branch or tag) to clone the radius app', "master")
|
|
|
+
|
|
|
->addOption('stats-repo',null, InputOption::VALUE_REQUIRED, 'Git clone Url fot the app Base', "git@bitbucket.org:ikflowdat/stats.git")
|
|
|
->addOption('stats-ref', null, InputOption::VALUE_REQUIRED, 'Git reference (branch or tag) to clone the Stats app', "master")
|
|
|
|
|
@@ -70,6 +73,11 @@ class Release extends Command
|
|
|
'url' => $input->getOption("mapas-repo"),
|
|
|
'branch' => $input->getOption("mapas-ref"),
|
|
|
),
|
|
|
+ "radius" => array(
|
|
|
+ 'url' => $input->getOption("radius-repo"),
|
|
|
+ 'branch' => $input->getOption("radius-ref"),
|
|
|
+ ),
|
|
|
+
|
|
|
"stats" => array(
|
|
|
'url' => $input->getOption("stats-repo"),
|
|
|
'branch' => $input->getOption("stats-ref"),
|
|
@@ -109,7 +117,7 @@ class Release extends Command
|
|
|
$dObj->file('install.yml')->content(
|
|
|
yaml::dump(array(
|
|
|
"install_dir" => realpath($dir),
|
|
|
- 'docker_apps' => array('base', 'stats', 'ftth', 'mapas'),
|
|
|
+ 'docker_apps' => array('base', /*'stats', 'ftth', 'mapas'*/),
|
|
|
'domain' => $domain,
|
|
|
)
|
|
|
)
|
|
@@ -147,47 +155,46 @@ inventory=inventory.ini
|
|
|
|
|
|
}
|
|
|
|
|
|
- function getDockerComposer( $v = "latest", $host_env_file = "host.env", $registry = "docker.infra.flowdat.com/", $fd_domain = "fd3.flowdat.com")
|
|
|
-{
|
|
|
-
|
|
|
-$mysql_root_pass="235r2342gtfsw";
|
|
|
-$mysql_user="iksop";
|
|
|
-$mysq_pass="235r2342gtfsw";
|
|
|
-
|
|
|
-$oauth_client = "1_3323sq6urn8kwccg8s4ok848ggwwgkw4c08wsc4cwkc08osocc";
|
|
|
-$oauth_client_secret = "5w7gx6ptdoo4g8cwwo88o8gowosgco84sso08ssow0osg88g8k";
|
|
|
-
|
|
|
- $composer = new FileFormat2("../");
|
|
|
-
|
|
|
+ function addBase($composer, $config = array(), $flavor = "dev"){
|
|
|
+ $version = "latest";
|
|
|
+ $domain = "fd3.flowdat.com";
|
|
|
+ extract($config);
|
|
|
$composer->addService("base")
|
|
|
- ->image($registry."fd3/base:" . $v)
|
|
|
+ ->image($registry."fd3/base:" . $version)
|
|
|
->build("./base/")
|
|
|
->restart("always")
|
|
|
->addLinks("mysql")
|
|
|
->addLinks("amqp")
|
|
|
- ->addEnviroment("VIRTUAL_HOST", "base.".$fd_domain)
|
|
|
- ->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("VIRTUAL_HOST", "base.".$domain)
|
|
|
+ ->addEnviroment("HOST_FTTH", "ftth.".$domain)
|
|
|
+ ->addEnviroment("HOST_STATS", "stats.".$domain)
|
|
|
+ ->addEnviroment("HOST_MAPAS", "mapas.".$domain)
|
|
|
+ ->addEnviroment("HOST_BASE", "base." .$domain)
|
|
|
->addVolumes("./base/", "/opt/base")
|
|
|
;
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
+ function addFtth($composer, $config = array(), $flavor = "dev"){
|
|
|
+ $version = "latest";
|
|
|
+ $domain = "fd3.flowdat.com";
|
|
|
+ extract($config);
|
|
|
+
|
|
|
$composer->addService("ftth")
|
|
|
- ->image($registry."fd3/ftth:" . $v)
|
|
|
+ ->image($registry."fd3/ftth:" . $version)
|
|
|
->build("./ftth/")
|
|
|
->restart("always")
|
|
|
->addLinks("mysql")
|
|
|
->addLinks("base")
|
|
|
->addLinks("amqp")
|
|
|
- ->addLinks("base", "base.".$fd_domain)
|
|
|
+ ->addLinks("base", "base.".$domain)
|
|
|
|
|
|
->addEnv_file("ftth.oauth.env")
|
|
|
- ->addEnviroment("VIRTUAL_HOST", "ftth.".$fd_domain)
|
|
|
- ->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("VIRTUAL_HOST", "ftth.".$domain)
|
|
|
+ ->addEnviroment("HOST_FTTH", "ftth.".$domain)
|
|
|
+ ->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")
|
|
@@ -195,112 +202,167 @@ $oauth_client_secret = "5w7gx6ptdoo4g8cwwo88o8gowosgco84sso08ssow0osg88g8k";
|
|
|
->addVolumes("./ftth/", "/opt/ftth")
|
|
|
;
|
|
|
|
|
|
- $composer->addService("mapas")
|
|
|
- ->image($registry."fd3/mapas:" . $v)
|
|
|
- ->build("./mapas/")
|
|
|
- ->addLinks("mysql")
|
|
|
- ->addLinks("base")
|
|
|
- ->addLinks("amqp")
|
|
|
- ->addLinks("base", "base.".$fd_domain)
|
|
|
- ->addEnv_file("mapas.oauth.env")
|
|
|
-
|
|
|
- ->addEnviroment("VIRTUAL_HOST", "mapas.".$fd_domain)
|
|
|
- ->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)
|
|
|
- //->addEnviroment("HTTPS_METHOD", "nohttps")
|
|
|
-
|
|
|
- ->addVolumes("./mapas/", "/opt/mapas")
|
|
|
- ->addVolumes("./mapas/web/uploads", "/opt/mapas/web/uploads")
|
|
|
- ;
|
|
|
+ }
|
|
|
|
|
|
+ function addStats($composer, $config = array(), $flavor = "dev"){
|
|
|
+ $version = "latest";
|
|
|
+ $domain = "fd3.flowdat.com";
|
|
|
+ extract($config);
|
|
|
|
|
|
$composer->addService("stats")
|
|
|
- ->image($registry."fd3/stats:" . $v)
|
|
|
+ ->image($registry."fd3/stats:" . $version)
|
|
|
->build("./stats/")
|
|
|
->addLinks("mysql")
|
|
|
->addLinks("base")
|
|
|
->addLinks("amqp")
|
|
|
- ->addLinks("base", "base.".$fd_domain)
|
|
|
- ->addLinks("jsendpoint", "endpoint")
|
|
|
- ->addLinks("statsd", "statsd")
|
|
|
+ ->addLinks("base", "base.".$domain)
|
|
|
+ //->addLinks("jsendpoint", "endpoint")
|
|
|
+ //->addLinks("statsd", "statsd")
|
|
|
->addVolumes("./stats/", "/opt/stats")
|
|
|
->addEnv_file("stats.oauth.env")
|
|
|
|
|
|
- ->addEnviroment("VIRTUAL_HOST", "stats.".$fd_domain)
|
|
|
- ->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("VIRTUAL_HOST", "stats.".$domain)
|
|
|
+ ->addEnviroment("HOST_FTTH", "ftth.".$domain)
|
|
|
+ ->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")
|
|
|
|
|
|
;
|
|
|
|
|
|
- /**************************************************************************************/
|
|
|
- /* Servicios */
|
|
|
- /**************************************************************************************/
|
|
|
- $composer->addService("mysql")->image($registry."fd3/mysql:". $v)
|
|
|
- ->build("./extra/mysql")
|
|
|
- ->addVolumes("./mysql/", "/var/lib/mysql/")
|
|
|
+ }
|
|
|
|
|
|
- ->addEnviroment("MYSQL_ROOT_PASSWORD", $mysql_root_pass)
|
|
|
- ->addEnviroment("MYSQL_USER", $mysql_user)
|
|
|
- ->addEnviroment("MYSQL_PASSWORD", $mysq_pass)
|
|
|
+ function addMapas($composer, $config = array(), $flavor = "dev"){
|
|
|
+ $version = "latest";
|
|
|
+ $domain = "fd3.flowdat.com";
|
|
|
+ extract($config);
|
|
|
+
|
|
|
+ $composer->addService("mapas")
|
|
|
+ ->image($registry."fd3/mapas:" . $version)
|
|
|
+ ->build("./mapas/")
|
|
|
+ ->addLinks("mysql")
|
|
|
+ ->addLinks("base")
|
|
|
+ ->addLinks("amqp")
|
|
|
+ ->addLinks("base", "base.".$domain)
|
|
|
+ ->addEnv_file("mapas.oauth.env")
|
|
|
+
|
|
|
+ ->addEnviroment("VIRTUAL_HOST", "mapas.".$domain)
|
|
|
+ ->addEnviroment("HOST_FTTH", "ftth.".$domain)
|
|
|
+ ->addEnviroment("HOST_STATS", "stats.".$domain)
|
|
|
+ ->addEnviroment("HOST_MAPAS", "mapas.".$domain)
|
|
|
+ ->addEnviroment("HOST_BASE", "base.".$domain)
|
|
|
+
|
|
|
+ ->addVolumes("./mapas/", "/opt/mapas")
|
|
|
+ ->addVolumes("./mapas/web/uploads", "/opt/mapas/web/uploads")
|
|
|
;
|
|
|
+ }
|
|
|
|
|
|
- $composer->addService("amqp")->image("rabbitmq:3-management")
|
|
|
+ function addNginx($composer, $config = array(), $flavor = "dev"){
|
|
|
+ $version = "latest";
|
|
|
+ $domain = "fd3.flowdat.com";
|
|
|
+ $host_env_file = "host.env";
|
|
|
+ extract($config);
|
|
|
+
|
|
|
+ $composer->addService("nginx")->build("extra/nginx/")
|
|
|
+ ->image($registry."fd3/nginx:".$version)
|
|
|
+ ->addEnv_file($host_env_file)
|
|
|
->restart("always")
|
|
|
+ ->addPorts(80, 80)
|
|
|
+ ->addPorts(443, 443)
|
|
|
+ ->addVolumes("/var/run/docker.sock", "/tmp/docker.sock:ro")
|
|
|
+ ->addVolumes("./extra/nginx/certs", "/etc/nginx/certs:ro")
|
|
|
+ ->addVolumes("./extra/nginx/vhost.d", "/etc/nginx/vhost.d")
|
|
|
+ ->addVolumes("./extra/nginx/share", "/usr/share/nginx/html")
|
|
|
;
|
|
|
+ }
|
|
|
|
|
|
+ function addMongDb($composer, $config = array(), $flavor = "dev"){
|
|
|
|
|
|
- /**************************************************************************************/
|
|
|
- /* Workers */
|
|
|
- /**************************************************************************************/
|
|
|
+ $version = "latest";
|
|
|
+ $domain = "fd3.flowdat.com";
|
|
|
+ $mongdb_version = "3.4";
|
|
|
+ extract($config);
|
|
|
|
|
|
- $composer->addService("ftth_worker")->image($registry."fd3/ftth:" . $v)
|
|
|
- ->build("./ftth/")
|
|
|
+ $composer->addService("mongodb")
|
|
|
+ ->image("mongo:". $mongdb_version)
|
|
|
+ ->addVolumes("./mongodb", "/data/db")
|
|
|
+ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ function addSupervisord($composer, $config = array(), $flavor = "dev"){
|
|
|
+
|
|
|
+ $version = "latest";
|
|
|
+ extract($config);
|
|
|
+
|
|
|
+ $composer->addService("supervisord")->build("./extra/supervisord")
|
|
|
+ ->image($registry."fd3/supervisord:$version")
|
|
|
+ ->privileged(true)
|
|
|
->restart("always")
|
|
|
- ->addLinks("mysql")
|
|
|
- ->addLinks("base")
|
|
|
- ->addLinks("amqp")
|
|
|
- ->addLinks("base", "base.".$fd_domain)
|
|
|
+ ->addEnviroment("./extra/supervisord/", "/etc/supervisord/")
|
|
|
+ ->addEnviroment("./extra/supervisord/var/", "/var/log/supervisor/")
|
|
|
+ ->addEnviroment("./extra/supervisord/sshd_config", "/etc/ssh/sshd_config")
|
|
|
+ ->addEnviroment("./extra/supervisord/bin/fiberhome", "/usr/bin/fiberhome")
|
|
|
+ ->addEnviroment("./extra/supervisord/bin/fiberlink", "/usr/bin/fiberlink")
|
|
|
+
|
|
|
+ ;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- ->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)
|
|
|
+ function addMySql($composer, $config = array(), $flavor = "dev"){
|
|
|
+ $version = "latest";
|
|
|
+ $domain = "fd3.flowdat.com";
|
|
|
+ extract($config);
|
|
|
|
|
|
- ->addVolumes("./ftth/", "/opt/ftth")
|
|
|
+ $composer->addService("mysql")->image($registry."fd3/mysql:". $version)
|
|
|
+ ->build("./extra/mysql")
|
|
|
+ ->addVolumes("./mysql/", "/var/lib/mysql/")
|
|
|
+ ->addEnviroment("MYSQL_ROOT_PASSWORD", $mysql_root_pass)
|
|
|
+ ->addEnviroment("MYSQL_USER", $mysql_user)
|
|
|
+ ->addEnviroment("MYSQL_PASSWORD", $mysql_pass)
|
|
|
;
|
|
|
+ }
|
|
|
|
|
|
+ function addRedis($composer, $config = array(), $flavor = "dev"){
|
|
|
+ $version = "latest";
|
|
|
+ $domain = "fd3.flowdat.com";
|
|
|
+ extract($config);
|
|
|
|
|
|
- $composer->addService("phpmyadmin")->image("phpmyadmin/phpmyadmin")
|
|
|
+ $composer->addService("redis")
|
|
|
+ ->image("redis:latest")
|
|
|
+ ->command("redis-server --appendonly yes")
|
|
|
+ //->addPorts("6379", "6379")
|
|
|
->restart("always")
|
|
|
- ->addPorts(8080, 80)
|
|
|
- ->addLinks("mysql", "db")
|
|
|
+ ;
|
|
|
+ }
|
|
|
|
|
|
- ->addEnviroment("MYSQL_ROOT_PASSWORD", $mysql_root_pass)
|
|
|
- ->addEnviroment("VIRTUAL_HOST", "pma.".$fd_domain)
|
|
|
- ->addEnviroment("HTTPS_METHOD", "nohttps")
|
|
|
+ function addGenieACS($composer, $config = array(), $flavor = "dev"){
|
|
|
+ $version = "latest";
|
|
|
+ $domain = "fd3.flowdat.com";
|
|
|
+ extract($config);
|
|
|
+
|
|
|
+ $composer->addService("genieacs")
|
|
|
+ ->image("thebinary/genieacs:latest")
|
|
|
+ ->addLinks("mongodb")
|
|
|
+ ->addLinks("redis")
|
|
|
+ ->addPorts("7777", "7777")
|
|
|
+ ->restart("always")
|
|
|
;
|
|
|
+ }
|
|
|
+
|
|
|
+ function addGrafana($composer, $config = array(), $flavor = "dev"){
|
|
|
+ $version = "latest";
|
|
|
+ $domain = "fd3.flowdat.com";
|
|
|
+ extract($config);
|
|
|
|
|
|
|
|
|
$composer->addService("grafana")->image("grafana/grafana")
|
|
|
|
|
|
- ->addLinks("jsendpoint","endpoint")
|
|
|
+ //->addLinks("jsendpoint","endpoint")
|
|
|
->addLinks("mysql")
|
|
|
->restart("always")
|
|
|
- ->addEnviroment("VIRTUAL_HOST", "grafana.".$fd_domain)
|
|
|
+ ->addEnviroment("VIRTUAL_HOST", "grafana.".$domain)
|
|
|
->addEnviroment("HTTPS_METHOD", "nohttps")
|
|
|
|
|
|
->addEnviroment("./statsd/grafana/lib", "/var/lib/grafana")
|
|
@@ -311,12 +373,28 @@ $oauth_client_secret = "5w7gx6ptdoo4g8cwwo88o8gowosgco84sso08ssow0osg88g8k";
|
|
|
->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")
|
|
|
+ $composer->addService("jsendpoint")
|
|
|
->build("./extra/statsd/endpoint/json")
|
|
|
- ->image($registry."fd3/jsonep:$v")
|
|
|
+ ->image($registry."fd3/jsonep:$version")
|
|
|
->addVolumes("./extra/statsd/endpoint/json", "/opt/datasource")
|
|
|
->addLinks("jsonep_mysql")
|
|
|
->addLinks("jsonep_mongo")
|
|
@@ -325,7 +403,7 @@ $oauth_client_secret = "5w7gx6ptdoo4g8cwwo88o8gowosgco84sso08ssow0osg88g8k";
|
|
|
|
|
|
$composer->addService("jsonep_mysql")
|
|
|
->build("./extra/statsd/endpoint/mysql")
|
|
|
- ->image($registry."fd3/jsonep_mysql:$v")
|
|
|
+ ->image($registry."fd3/jsonep_mysql:$version")
|
|
|
->addVolumes("./extra/statsd/endpoint/mysql", "/opt/datasource")
|
|
|
->addLinks("mysql")
|
|
|
->addEnviroment("MYSQL_ROOT_PASSWORD", $mysql_root_pass)
|
|
@@ -334,65 +412,139 @@ $oauth_client_secret = "5w7gx6ptdoo4g8cwwo88o8gowosgco84sso08ssow0osg88g8k";
|
|
|
|
|
|
$composer->addService("jsonep_mongo")
|
|
|
->build("./extra/statsd/endpoint/mongodb")
|
|
|
- ->image($registry."fd3/jsonep_mongo:$v")
|
|
|
+ ->image($registry."fd3/jsonep_mongo:$version")
|
|
|
->addVolumes("./extra/statsd/endpoint/mongodb", "/opt/datasource")
|
|
|
->addLinks("mongodb")
|
|
|
->restart("always")
|
|
|
;
|
|
|
+ }
|
|
|
|
|
|
- $composer->addService("mongodb")
|
|
|
- ->image("mongo:3.4")
|
|
|
- ->addVolumes("./mongodb", "/data/db")
|
|
|
- ;
|
|
|
+ function addCommandWorkers($composer, $config = array(), $flavor = "dev"){
|
|
|
+ $version = "latest";
|
|
|
+ $domain = "fd3.flowdat.com";
|
|
|
+ extract($config);
|
|
|
|
|
|
- $composer->addService("redis")
|
|
|
- ->image("redis:latest")
|
|
|
- ->addPorts("6379", "6379")
|
|
|
- ->restart("always")
|
|
|
+ $composer->addService("base_log_worker")->image($registry."fd3/base:" . $version)
|
|
|
+ ->build("./base/")
|
|
|
+ ->command("bin/console rabbitmq:consumer log_consumer")
|
|
|
+ ->restart("always")
|
|
|
+ ->addLinks("mysql")
|
|
|
+ ->addLinks("base")
|
|
|
+ ->addLinks("amqp")
|
|
|
+ ->addLinks("nginx", "base.".$domain)
|
|
|
+ ->addVolumes("./base/", "/opt/base")
|
|
|
;
|
|
|
|
|
|
- $composer->addService("genieacs")
|
|
|
- ->image("thebinary/genieacs:latest")
|
|
|
- ->addLinks("mongodb")
|
|
|
- ->addLinks("redis")
|
|
|
- ->addPorts("7777", "7777")
|
|
|
- ->restart("always")
|
|
|
+ $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("statsd")->build("./extra/statsd/statsd")
|
|
|
- ->image($registry."fd3/statsd:$v")
|
|
|
- ->addPorts("8125", "8125/udp")
|
|
|
- ->addLinks("mysql")
|
|
|
- ->addLinks("mongodb")
|
|
|
+ $composer->addService("ftth_tasklogger_worker")->image($registry."fd3/ftth:" . $version)
|
|
|
+ ->build("./ftth/")
|
|
|
+ ->command("bin/console rabbitmq:consumer flowdat_tasklogger")
|
|
|
->restart("always")
|
|
|
- ->addVolumes("./extra/statsd/statsd/statsd.config.js", "/opt/config/statsd.config.js")
|
|
|
+ ->addLinks("mysql")
|
|
|
+ ->addLinks("base")
|
|
|
+ ->addLinks("amqp")
|
|
|
+ ->addLinks("nginx", "base.".$domain)
|
|
|
+ ->addVolumes("./ftth/", "/opt/ftth")
|
|
|
;
|
|
|
|
|
|
- $composer->addService("supervisord")->build("./extra/supervisord")
|
|
|
- ->image($registry."fd3/supervisord:$v")
|
|
|
- ->privileged(true)
|
|
|
+ $composer->addService("stats_command_worker")->image($registry."fd3/ftth:" . $version)
|
|
|
+ ->build("./stats/")
|
|
|
+ ->command("bin/console rabbitmq:consumer command_consumer")
|
|
|
->restart("always")
|
|
|
- ->addEnviroment("./extra/supervisord/", "/etc/supervisord/")
|
|
|
- ->addEnviroment("./extra/supervisord/var/", "/var/log/supervisor/")
|
|
|
- ->addEnviroment("./extra/supervisord/sshd_config", "/etc/ssh/sshd_config")
|
|
|
- ->addEnviroment("./extra/supervisord/bin/fiberhome", "/usr/bin/fiberhome")
|
|
|
- ->addEnviroment("./extra/supervisord/bin/fiberlink", "/usr/bin/fiberlink")
|
|
|
-
|
|
|
+ ->addLinks("mysql")
|
|
|
+ ->addLinks("base")
|
|
|
+ ->addLinks("amqp")
|
|
|
+ ->addLinks("nginx", "base.".$domain)
|
|
|
+ ->addVolumes("./stats/", "/opt/stats")
|
|
|
;
|
|
|
+ }
|
|
|
|
|
|
- $composer->addService("nginx")->build("extra/nginx/")
|
|
|
- ->image($registry."fd3/nginx:".$v)
|
|
|
- ->addEnv_file($host_env_file)
|
|
|
+ function getDockerComposer( $version = "latest", $host_env_file = "host.env", $registry = "docker.infra.flowdat.com/", $fd_domain = "fd3.flowdat.com")
|
|
|
+ {
|
|
|
+
|
|
|
+$mysql_root_pass="235r2342gtfsw";
|
|
|
+$mysql_user="iksop";
|
|
|
+$mysql_pass="235r2342gtfsw";
|
|
|
+
|
|
|
+$oauth_client = "1_3323sq6urn8kwccg8s4ok848ggwwgkw4c08wsc4cwkc08osocc";
|
|
|
+$oauth_client_secret = "5w7gx6ptdoo4g8cwwo88o8gowosgco84sso08ssow0osg88g8k";
|
|
|
+
|
|
|
+ $composer = new FileFormat2("../");
|
|
|
+
|
|
|
+ $base_vars = array("version" => $version, "host_env_file" => $host_env_file, "domain" => $fd_domain, "registry" => $registry);
|
|
|
+
|
|
|
+ $this->addNginx($composer, $base_vars);
|
|
|
+
|
|
|
+ /**************************************************************************************/
|
|
|
+ /* Apps / Web UI */
|
|
|
+ /**************************************************************************************/
|
|
|
+
|
|
|
+ $this->addBase($composer, $base_vars);
|
|
|
+ $this->addFtth($composer, $base_vars);
|
|
|
+ $this->addStats($composer, $base_vars);
|
|
|
+ $this->addMapas($composer, $base_vars);
|
|
|
+
|
|
|
+
|
|
|
+ /**************************************************************************************/
|
|
|
+ /* Servicios */
|
|
|
+ /**************************************************************************************/
|
|
|
+ $this->addMySql($composer, $base_vars + array(
|
|
|
+ 'mysql_root_pass' => $mysql_root_pass,
|
|
|
+ 'mysql_user' => $mysql_user,
|
|
|
+ 'mysql_pass' => $mysql_pass,
|
|
|
+ ));
|
|
|
+
|
|
|
+ $composer->addService("amqp")->image("rabbitmq:3-management")
|
|
|
->restart("always")
|
|
|
- ->addPorts(80, 80)
|
|
|
- ->addPorts(443, 443)
|
|
|
- ->addVolumes("/var/run/docker.sock", "/tmp/docker.sock:ro")
|
|
|
- ->addVolumes("./extra/nginx/certs", "/etc/nginx/certs:ro")
|
|
|
- ->addVolumes("./extra/nginx/vhost.d", "/etc/nginx/vhost.d")
|
|
|
- ->addVolumes("./extra/nginx/share", "/usr/share/nginx/html")
|
|
|
;
|
|
|
|
|
|
+ $this->addMongDb($composer, $base_vars);
|
|
|
+ $this->addRedis($composer);
|
|
|
+
|
|
|
+ /**************************************************************************************/
|
|
|
+ /* Grafana y compoenentes de las estadisticas*/
|
|
|
+ /**************************************************************************************/
|
|
|
+ $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,
|
|
|
+ ));
|
|
|
+
|
|
|
+
|
|
|
+ /**************************************************************************************/
|
|
|
+ /* Workers */
|
|
|
+ /**************************************************************************************/
|
|
|
+
|
|
|
+ $this->addSupervisord($composer, $base_vars);
|
|
|
+
|
|
|
+ $this->addCommandWorkers($composer, $base_vars);
|
|
|
+
|
|
|
+
|
|
|
+ //$composer->addService("phpmyadmin")->image("phpmyadmin/phpmyadmin")
|
|
|
+ // ->restart("always")
|
|
|
+ // ->addPorts(8080, 80)
|
|
|
+ // ->addLinks("mysql", "db")
|
|
|
+
|
|
|
+ // ->addEnviroment("MYSQL_ROOT_PASSWORD", $mysql_root_pass)
|
|
|
+ // ->addEnviroment("VIRTUAL_HOST", "pma.".$fd_domain)
|
|
|
+ // ->addEnviroment("HTTPS_METHOD", "nohttps")
|
|
|
+ //;
|
|
|
|
|
|
+
|
|
|
return $composer->render();
|
|
|
}
|
|
|
}
|