diff --git a/srcs/mariadb/Dockerfile b/srcs/mariadb/Dockerfile new file mode 100644 index 0000000..f1c9f70 --- /dev/null +++ b/srcs/mariadb/Dockerfile @@ -0,0 +1,10 @@ +FROM alpine:3.17 + +RUN apk update + +RUN apk add mariadb +RUN mariadb-install-db +RUN mkdir /run/mysqld +COPY init.sql /etc + +ENTRYPOINT ["mariadbd", "--no-defaults", "--user=root", "--datadir=/data", "--init-file=/etc/init.sql"] diff --git a/srcs/mariadb/init.sql b/srcs/mariadb/init.sql new file mode 100644 index 0000000..10c29ec --- /dev/null +++ b/srcs/mariadb/init.sql @@ -0,0 +1,2 @@ +CREATE DATABASE wordpress; +GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'%' IDENTIFIED BY 'wordpress';