really done?

This commit is contained in:
kinou-p 2022-10-09 11:25:04 +02:00
parent 25a4ffacd1
commit 2014a71dba
2 changed files with 10 additions and 3 deletions

View File

@ -20,3 +20,4 @@ COPY ./tools/ /mysql_scripts/
EXPOSE 3306 EXPOSE 3306
WORKDIR /mysql_scripts WORKDIR /mysql_scripts
ENTRYPOINT ["bash", "sqlStart.sh"] ENTRYPOINT ["bash", "sqlStart.sh"]
#ENTRYPOINT ["bash", "work.sh"]

View File

@ -5,9 +5,15 @@ service mysql start
if [ ! -d /var/lib/mysql/wordpress ] if [ ! -d /var/lib/mysql/wordpress ]
then then
echo "----sql config----" echo "----sql config----"
mysql < db.sh
#mysql -u root < pwd.sh
mysql << EOF
CREATE DATABASE IF NOT EXISTS ${MARIADB_DATABASE};
CREATE USER IF NOT EXISTS '${MARIADB_USER}'@'%' IDENTIFIED BY '${MARIADB_PASSWORD}';
GRANT ALL PRIVILEGES ON *.* TO '${MARIADB_USER}'@'%';
FLUSH PRIVILEGES;
EOF
mysql -u root < pwd.sh
echo "----sql config done----"
fi fi
service mysql stop service mysql stop
mysqld mysqld