setHelp("Modulo de logs de tareas del ftth") ->setHostEnv(false) ->setVarEnv([]) ->setOauth(false) ->setRequired(false) ->setDepends(['ftth']); } /** * 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/") ->addVolumes("./netmiko/", "/opt/netmiko/") ->addVolumes("./connect/", "/usr/bin/connect/"); } $this->getComposer()->service($module) ->hostname($module) ->command("bin/console rabbitmq:consumer flowdat_tasklogger") ->restart($this->getRelease()->_docker_restart_task) ->addEnv_file($this->getRelease()->_running_env) ->addEnv_file($this->getRelease()->_host_env) ->addEnv_file("$initial." . $this->getRelease()->_host_env) ->addEnviroment("AMQP_KEY", "$initial") ->addVolumes("./backups-config", "/opt/ftth/web/backups-config") ->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); } } }