Emalawi19 commited on
Commit
de3cdcb
·
verified ·
1 Parent(s): b871f4d

Update start.sh

Browse files
Files changed (1) hide show
  1. start.sh +7 -7
start.sh CHANGED
@@ -1,20 +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;"
 
1
  #!/bin/bash
2
 
3
+ # 1. Start the MySQL/MariaDB service
4
  service mariadb start
 
 
5
  sleep 3
6
 
7
+ # 2. Setup master database credentials
 
8
  mysql -e "CREATE USER IF NOT EXISTS 'admin'@'localhost' IDENTIFIED BY 'orchestrator_master_pass';"
9
  mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;"
10
  mysql -e "FLUSH PRIVILEGES;"
11
 
12
+ # 3. Ensure Nginx can read the repository files
13
+ chown -R www-data:www-data /app
14
+
15
+ # 4. Start PHP FastCGI
16
  service php8.1-fpm start
17
 
18
+ # 5. Start Nginx
19
  echo "Starting Nginx web server..."
20
  nginx -g "daemon off;"