Spaces:
Sleeping
Sleeping
Update start.sh
Browse files
start.sh
CHANGED
|
@@ -1,20 +1,20 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
-
# 1. Start the MySQL/MariaDB service
|
| 4 |
service mariadb start
|
| 5 |
-
|
| 6 |
-
# Wait a moment for the database to fully initialize
|
| 7 |
sleep 3
|
| 8 |
|
| 9 |
-
# 2.
|
| 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.
|
|
|
|
|
|
|
|
|
|
| 16 |
service php8.1-fpm start
|
| 17 |
|
| 18 |
-
#
|
| 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;"
|