Check if running in docker
This commit is contained in:
1 parent
12bf008b3f
commit
ec1d0e8c5d
1 file changed
+6
-6
@@ -248,12 +248,12 @@ def signal_handler(sig, frame):
|
|||||||
|
|
||||||
# Attach the signal handler to the SIGINT signal (Ctrl+C)
|
# Attach the signal handler to the SIGINT signal (Ctrl+C)
|
||||||
signal.signal(signal.SIGINT, signal_handler)
|
signal.signal(signal.SIGINT, signal_handler)
|
||||||
|
# Check if we're running in docker
|
||||||
try:
|
if os.path.isfile("/.dockerenv"):
|
||||||
response = requests.get(f"{base_url}/ready")
|
print(
|
||||||
if response.status_code == 200:
|
f"[{params['branding']}Startup] \033[94mRunning in Docker. Please wait.\033[0m"
|
||||||
pass
|
)
|
||||||
except:
|
else:
|
||||||
# Start the subprocess
|
# Start the subprocess
|
||||||
process = subprocess.Popen(["python", script_path])
|
process = subprocess.Popen(["python", script_path])
|
||||||
# Check if the subprocess has started successfully
|
# Check if the subprocess has started successfully
|
||||||
|
|||||||
Reference in new issue
Block a user