From 328b40f0f676bcc3ca22ca40185c73f57ece5ec3 Mon Sep 17 00:00:00 2001 From: WilliamMiceli Date: Fri, 22 Nov 2019 22:31:47 -0500 Subject: [PATCH] Another attempt at setting up the database properly --- Dockerfile | 9 ++------- mysql_setup.sql | 5 +++++ 2 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 mysql_setup.sql diff --git a/Dockerfile b/Dockerfile index 077fb5e..12c1105 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,13 +17,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins COPY /etc/ /etc/ # Setting up MySQL --Will come back to later, as it's not necessary and not playing very well with automation -RUN mysql -u root <<-EOF - UPDATE mysql.user SET authentication_string=PASSWORD('Password1234') WHERE User='root'; - DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1'); - DELETE FROM mysql.user WHERE User=''; - DELETE FROM mysql.db WHERE Db='test' OR Db='test_%'; - FLUSH PRIVILEGES; - EOF +RUN mysql -u root < mysql_setup.sql + # Copying in startup script COPY /entrypoint.sh / diff --git a/mysql_setup.sql b/mysql_setup.sql new file mode 100644 index 0000000..4164de6 --- /dev/null +++ b/mysql_setup.sql @@ -0,0 +1,5 @@ +UPDATE mysql.user SET authentication_string=PASSWORD('Password1234') WHERE User='root'; +DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1'); +DELETE FROM mysql.user WHERE User=''; +DELETE FROM mysql.db WHERE Db='test' OR Db='test_%'; +FLUSH PRIVILEGES; \ No newline at end of file