mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-22 15:40:22 +00:00
Update docker.py
This commit is contained in:
parent
631189cbf4
commit
9108e2ee18
1 changed files with 5 additions and 4 deletions
|
@ -10,14 +10,15 @@ from pathlib import Path
|
|||
def get_process_perc(app_name):
|
||||
|
||||
process_now = "pulling"
|
||||
output = "sudo docker image list |grep " + app_name
|
||||
output = shell_execute.execute_command_output_all("sudo docker image list |grep " + app_name)
|
||||
code = output["code"]
|
||||
if int(code) == 0 and output["result"] != "":
|
||||
process_now = "starting"
|
||||
output = "sudo docker compose ls |grep " + app_name
|
||||
http_port = read_env(path, "APP_HTTP_PORT")
|
||||
output = shell_execute.execute_command_output_all("curl localhost:" + http_port)
|
||||
code = output["code"]
|
||||
if int(code) == 0 and output["result"] != "":
|
||||
process_now = "initializing"
|
||||
if int(code) == 0 and output["result"].find("Failed connect")!= -1:
|
||||
process_now = "running"
|
||||
|
||||
|
||||
return process_now
|
||||
|
|
Loading…
Reference in a new issue