Emalawi19 commited on
Commit
8712117
·
verified ·
1 Parent(s): 68bafca

Create start.sh

Browse files
Files changed (1) hide show
  1. start.sh +20 -0
start.sh ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # 1. Start the MySQL/MariaDB service in the background
4
+ service mariadb start
5
+
6
+ # Wait a moment for the database to fully initialize
7
+ sleep 3
8
+
9
+ # 2. Secure and initialize the root database user
10
+ # (The orchestrator will connect using these credentials to create user databases later)
11
+ mysql -e "CREATE USER IF NOT EXISTS 'admin'@'localhost' IDENTIFIED BY 'orchestrator_master_pass';"
12
+ mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;"
13
+ mysql -e "FLUSH PRIVILEGES;"
14
+
15
+ # 3. Start PHP FastCGI Process Manager
16
+ service php8.1-fpm start
17
+
18
+ # 4. Start Nginx in the foreground so the Docker container stays alive
19
+ echo "Starting Nginx web server..."
20
+ nginx -g "daemon off;"