修改了基于docker 一键部署的Dockerfile 和dockercompose.yaml

This commit is contained in:
ranee@ubuntu
2023-05-07 02:34:58 +08:00
parent 0d0998ec3c
commit 157a83711f
6 changed files with 146 additions and 1 deletions
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash
# Wait for MySQL container to be ready
echo "Waiting for MySQL container to start..."
until mysql -h mysql -uroot -p123456 -e ";" 2>/dev/null; do
echo "MySQL container not ready, sleeping for 5 seconds..."
sleep 5
done
echo "MySQL container started successfully!"
# to start create the dababase
echo " start to create the databse... "
mysql -uroot -p123456 -hmysql -e 'CREATE DATABASE PearAdminFlask DEFAULT CHARSET UTF8;'
# Initialize Flask database
echo "Initializing Flask database..."
flask db init
flask db migrate
flask db upgrade
flask admin init
# Start Flask application
echo "Starting Flask application..."
python3 app.py