upgrade makefile, add env var to mariadb
This commit is contained in:
@ -5,6 +5,6 @@ RUN apk update
|
||||
RUN apk add mariadb
|
||||
RUN mariadb-install-db
|
||||
RUN mkdir /run/mysqld
|
||||
COPY init.sql /etc
|
||||
COPY init.sql entrypoint.sh /etc/
|
||||
|
||||
ENTRYPOINT ["mariadbd", "--no-defaults", "--user=root", "--datadir=/data", "--init-file=/etc/init.sql"]
|
||||
ENTRYPOINT ["sh", "/etc/entrypoint.sh"]
|
||||
|
6
srcs/mariadb/entrypoint.sh
Normal file
6
srcs/mariadb/entrypoint.sh
Normal file
@ -0,0 +1,6 @@
|
||||
sed -i "s/DB_USER/$DB_USER/g" /etc/init.sql
|
||||
sed -i "s/DB_PASS/$DB_PASS/g" /etc/init.sql
|
||||
|
||||
cat /etc/init.sql >/dev/stderr
|
||||
|
||||
exec mariadbd --no-defaults --user=root --datadir=/data --init-file=/etc/init.sql
|
@ -1,2 +1,2 @@
|
||||
CREATE DATABASE wordpress;
|
||||
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'%' IDENTIFIED BY 'wordpress';
|
||||
GRANT ALL PRIVILEGES ON wordpress.* TO 'DB_USER'@'%' IDENTIFIED BY 'DB_PASS';
|
||||
|
Reference in New Issue
Block a user