diff --git a/appmanage/Dockerfile b/appmanage/Dockerfile index 9810c1ca..bf97146f 100644 --- a/appmanage/Dockerfile +++ b/appmanage/Dockerfile @@ -10,7 +10,7 @@ COPY static ./static COPY requirements.txt main.py ./ RUN apt update -# Install supervisordss +# Install supervisord RUN apt install -y supervisor COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY config/cmd.sh /cmd.sh @@ -18,5 +18,5 @@ RUN chmod +x /etc/supervisor/conf.d/supervisord.conf /cmd.sh RUN pip install -r requirements.txt RUN mkdir /data -# Expose the port in which the application will be deployed +# Expose the port in which the application will be deployeds EXPOSE 5000 \ No newline at end of file diff --git a/appmanage/api/service/manage.py b/appmanage/api/service/manage.py index d616af23..1dc9d730 100644 --- a/appmanage/api/service/manage.py +++ b/appmanage/api/service/manage.py @@ -326,7 +326,7 @@ def get_apps_from_compose(): default_domain = "" if customer_name in ['w9appmanage', 'w9nginxproxymanager','w9redis','w9portainer'] and app_path == '/data/apps/stackhub/docker/' + customer_name: continue - # get code + status = app_info["Status"].split("(")[0] if status == "running" or status == "exited" or status == "restarting": myLogger.info_logger("ok") @@ -352,8 +352,9 @@ def get_apps_from_compose(): image_url = get_Image_url(app_name) # get env info path = app_path + "/.env" + env_map = docker.get_map(path) try: - domain = list(docker.read_env(path, "APP_URL").values())[0] + domain = env_map.get("APP_URL") if "appname.example.com" in domain or ip in domain: default_domain = "" else: diff --git a/appmanage/api/utils/docker.py b/appmanage/api/utils/docker.py index 8883a77f..92bc67f0 100644 --- a/appmanage/api/utils/docker.py +++ b/appmanage/api/utils/docker.py @@ -177,6 +177,17 @@ def check_app_url(customer_app_name): myLogger.info_logger("App url check complete") return +def get_map(path): + myLogger.info_logger("Read env_dic" + path) + output = shell_execute.execute_command_output_all("cat " + path) + code = output["code"] + env_dic = {} + if int(code) == 0: + ret = output["result"] + env_list = ret.split("\n") + for env in env_list: + env_dic[env.split("=")[0]] = env.split("=")[1] + return env_dic def read_env(path, key): myLogger.info_logger("Read " + path)