Parcourir la source

set domain when app_url is null

qiaofeng1227 il y a 2 ans
Parent
commit
6051b6376e
2 fichiers modifiés avec 4 ajouts et 3 suppressions
  1. 1 1
      appmanage/Dockerfile
  2. 3 2
      appmanage/api/service/manage.py

+ 1 - 1
appmanage/Dockerfile

@@ -10,7 +10,7 @@ COPY static ./static
 COPY requirements.txt main.py  ./
 RUN apt update
 
-# Install supervisord
+# Install supervisords
 RUN apt install -y supervisor
 COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
 COPY config/cmd.sh /cmd.sh

+ 3 - 2
appmanage/api/service/manage.py

@@ -1054,8 +1054,9 @@ def set_domain(domain, app_id):
         myLogger.info_logger("APP_URL is not exist")
         if domain == "":
             ip_result = shell_execute.execute_command_output_all("cat /data/apps/stackhub/docker/w9appmanage/public_ip")
-            domain = ip_result["result"].rstrip('\n')           
-        cmd = "echo -e \"\nAPP_URL=" + domain + "\" >> /data/apps/" + customer_name +"/.env"
+            domain = ip_result["result"].rstrip('\n') 
+                
+        cmd = "sed -i '/APP_NETWORK/a APP_URL=" + domain + "' /data/apps/" + customer_name +"/.env"
         shell_execute.execute_command_output_all(cmd)
     myLogger.info_logger("set_domain success")