Merge remote-tracking branch 'origin/master'

This commit is contained in:
不胜舟
2023-05-30 01:00:16 +08:00
3 changed files with 26 additions and 31 deletions
+1
View File
@@ -1,6 +1,7 @@
FROM pearadminflask/python3.7-flask:pillow
COPY . /app/
COPY dockerdata/start.sh /app/
COPY dockerdata/gunicorn.conf.py /app/
WORKDIR /app/
+24 -5
View File
@@ -1,6 +1,25 @@
#!/bin/sh
while ! flask db init ; do
sleep 5 ;
done ;
flask db migrate && flask db upgrade && flask admin init
#!/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 gunicorn application
echo "Starting gunicorn application..."
exec gunicorn -c gunicorn.conf.py "applications:create_app()"
-25
View File
@@ -1,25 +0,0 @@
#!/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 gunicorn application
echo "Starting gunicorn application..."
exec gunicorn -c gunicorn.conf.py "applications:create_app()"