-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.py
36 lines (26 loc) · 848 Bytes
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os
import webbrowser
import time
# Define Docker Compose commands
DOCKER_COMPOSE_UP = "docker-compose up --build -d"
DOCKER_COMPOSE_DOWN = "docker-compose down"
# URLs to open
url = "http://localhost:5000/browser/" # postgres admin
# Function to run a shell command
def run_command(command):
print(f"Running: {command}")
result = os.system(command)
if result != 0:
print(f"Command failed: {command}")
else:
print(f"Command succeeded: {command}")
# Start Docker Compose
run_command(DOCKER_COMPOSE_DOWN + " && " + DOCKER_COMPOSE_UP)
# Wait for services to start
print("Waiting for services to start...")
# time.sleep(30) # Adjust this time as needed based on your services
# Open URLs in Chrome
# for url in urls:
# print(f"Open URL: {url}")
# webbrowser.open(url)
# Provide user instructions