Update manage.py

This commit is contained in:
qiaofeng1227 2023-05-11 15:12:53 +08:00 committed by GitHub
parent b4bd2f9b08
commit 1943c6a109
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -586,7 +586,7 @@ def app_domain_update(app_id, domains):
'Authorization': token,
'Content-Type': 'application/json'
}
port = ""
port = get_container_port(app_id.split('_')[1])
host = app_id.split('_')[1]
data = {
"domain_names": domains,
@ -636,7 +636,7 @@ def app_domain_add(app_id, domains):
'Authorization': token,
'Content-Type': 'application/json'
}
port = ""
port = get_container_port(app_id.split('_')[1])
host = app_id.split('_')[1]
data = {
"domain_names": domains,
@ -741,3 +741,13 @@ def set_domain(domain,app_id):
else:
cmd = "sed -i 's/APP_URL=.*/APP_URL=" + domain + "/g /data/apps/" + customer_name +"/.env"
shell_execute.execute_command_output_all(cmd)
def get_container_port(container_name):
port = "80"
cmd = "docker container inspect " + container_name\
result = shell_execute.execute_command_output_all(cmd)["result"]
myLogger.info_logger(result)
response = json.dumps(result)
myLogger.info_logger(response)
return port