wp fail certainly because docker build have no access to docker network

This commit is contained in:
hugo gogo
2022-09-10 09:56:01 +02:00
parent 1b48f4b6d3
commit e994b60790
7 changed files with 61 additions and 14 deletions

View File

@@ -10,15 +10,12 @@ RUN apt update && apt install -y \
&& \
rm -rf /var/lib/apt/lists/*
# (NOT NECESSARY : DONE BY WP)
# 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 &{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';
mariadb --execute="GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'localhost' with grant option;"
CMD [ "mysqld" ]