trying to install wordpress with cli
This commit is contained in:
@@ -4,14 +4,21 @@ ARG DB_NAME
|
||||
ARG DB_USER
|
||||
ARG DB_PSWD
|
||||
|
||||
RUN apt update && \
|
||||
apt install -y mariadb-client mariadb-server && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
\
|
||||
service mysql start && \
|
||||
RUN apt update && apt install -y \
|
||||
mariadb-client \
|
||||
mariadb-server \
|
||||
&& \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# configure wp database
|
||||
RUN service mysql start && \
|
||||
mariadb --execute="CREATE DATABASE ${DB_NAME};" && \
|
||||
mariadb --execute="CREATE USER '${DB_USER}'@'localhost' IDENTIFIED BY '${DB_PSWD}';" && \
|
||||
mariadb --execute="GRANT ALL PRIVILEGES ON *.* TO '${DB_USER}'@'localhost' with grant option;"
|
||||
mariadb --execute="GRANT ALL PRIVILEGES ON &{DB_NAME}.* TO '${DB_USER}'@'localhost' with grant option;"
|
||||
|
||||
# alternative : (https://mariadb.com/resources/blog/how-to-install-and-run-wordpress-with-mariadb/)
|
||||
# create database new_wp;
|
||||
# grant all privileges on new_wp.* to wpuser@localhost identified by 'myp@Ssw0Rd';
|
||||
|
||||
CMD [ "mysqld" ]
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
mon_super_mot_de_passe
|
||||
Reference in New Issue
Block a user