From ec1d0e8c5d3b092520a119f9b02a22238eefce95 Mon Sep 17 00:00:00 2001 From: Josh XT Date: Mon, 22 Jan 2024 19:26:23 -0500 Subject: [PATCH] Check if running in docker --- script.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/script.py b/script.py index a02d79c..5cee0f6 100644 --- a/script.py +++ b/script.py @@ -248,12 +248,12 @@ def signal_handler(sig, frame): # Attach the signal handler to the SIGINT signal (Ctrl+C) signal.signal(signal.SIGINT, signal_handler) - -try: - response = requests.get(f"{base_url}/ready") - if response.status_code == 200: - pass -except: +# Check if we're running in docker +if os.path.isfile("/.dockerenv"): + print( + f"[{params['branding']}Startup] \033[94mRunning in Docker. Please wait.\033[0m" + ) +else: # Start the subprocess process = subprocess.Popen(["python", script_path]) # Check if the subprocess has started successfully