1
0
Fork 0
This commit is contained in:
Henrik Hautakoski 2026-02-25 15:17:54 +01:00
parent 4f104fe4f9
commit aeecf0d395
5 changed files with 71 additions and 6 deletions

4
docker/mysql/Dockerfile Normal file
View file

@ -0,0 +1,4 @@
FROM mysql/mysql-server:8.0
COPY create-testing-database.sh /docker-entrypoint-initdb.d/10-create-testing-database.sh
RUN chmod +x /docker-entrypoint-initdb.d/10-create-testing-database.sh
RUN chown -R mysql:mysql /docker-entrypoint-initdb.d

View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
mysql --user=root --password="$MYSQL_ROOT_PASSWORD" <<-EOSQL
CREATE DATABASE IF NOT EXISTS testing;
GRANT ALL PRIVILEGES ON \`testing%\`.* TO '$MYSQL_USER'@'%';
EOSQL