|
@@ -0,0 +1,65 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace FD3\Services;
|
|
|
+
|
|
|
+use Docker\Composer\FileFormat;
|
|
|
+use FD3\Release;
|
|
|
+
|
|
|
+class Radius_task extends InitialService
|
|
|
+{
|
|
|
+ /**
|
|
|
+ * @var int ip server
|
|
|
+ */
|
|
|
+ protected $ip_server = 36;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Radius_tasklogger_worker constructor.
|
|
|
+ */
|
|
|
+ public function __construct()
|
|
|
+ {
|
|
|
+ $this
|
|
|
+ ->setHelp("Modulo de logs de tareas del radius")
|
|
|
+ ->setHostEnv(false)
|
|
|
+ ->setVarEnv([])
|
|
|
+ ->setOauth(false)
|
|
|
+ ->setRequired(false)
|
|
|
+ ->setDepends(['radius']);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Add config
|
|
|
+ * @throws \Docker\Composer\ServiceNotFoundException
|
|
|
+ */
|
|
|
+ public function add()
|
|
|
+ {
|
|
|
+ $module = $this->getModuleName();
|
|
|
+ $initial = $this->getInitialName();
|
|
|
+ $version = "latest";
|
|
|
+ $registry = "";
|
|
|
+ extract($this->getConfigVar());
|
|
|
+ if ($this->getRelease()->needInstallModule($module)) {
|
|
|
+ $this->getComposer()->addService($module)
|
|
|
+ ->image($registry . "fd3/$initial:" . $version);
|
|
|
+ if ($this->getProduction() === false) {
|
|
|
+ $this->getComposer()->service($module)
|
|
|
+ ->build("./$initial/")
|
|
|
+ ->addVolumes("./$initial/", "/opt/$initial/");
|
|
|
+ }
|
|
|
+ $this->getComposer()->service($module)
|
|
|
+ ->hostname($module)
|
|
|
+ ->command("bin/console rabbitmq:consumer flowdat_tasklogger")
|
|
|
+ ->restart($this->getRelease()->_docker_restart_default)
|
|
|
+ ->addEnv_file($this->getRelease()->_running_env)
|
|
|
+ ->addEnv_file($this->getRelease()->_host_env)
|
|
|
+ ->addEnv_file("$initial." . $this->getRelease()->_host_env)
|
|
|
+ ->addEnviroment("AMQP_KEY", "$initial")
|
|
|
+ ->addVolumes("/etc/localtime:/etc/localtime:ro")
|
|
|
+ ->addVolumes("./hosts:/etc/hosts")
|
|
|
+ ->network($this->getRelease()->_network_name)->ipv4_address($this->generateIP());
|
|
|
+ $this->addLink(new Mysql(), $module)
|
|
|
+ ->addLink(new Base(), $module)
|
|
|
+ ->addLinkNginx(new Base(), $module);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|