From 7e0d85db834d6351ed85d01e5126ac31dc510b86 Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 8 Jan 2020 19:03:35 +0100 Subject: wordpress working with mysql --- Dockerfile | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 28f93bc..7b0c0e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,22 +2,28 @@ FROM debian:buster RUN apt update && \ apt install -y nginx \ - mariadb-server \ php-fpm \ - php-mysql \ - phpmyadmin \ - php-mbstring \ - php-gettext + mariadb-server \ + php-mysql + # phpmyadmin \ + # php-mbstring \ + # php-gettext -COPY srcs/wordpress /var/www/html COPY srcs/conf /etc/nginx/sites-available/ +COPY srcs/wordpress /var/www +# COPY srcs/test /var/www RUN ln -fs /etc/nginx/sites-available/test.com /etc/nginx/sites-enabled/default EXPOSE 80 -RUN service nginx start && \ - service mysql start && \ - service php7.3-fpm start +RUN service mysql start && \ + echo "CREATE DATABASE testdb;" | mysql -u root && \ + echo "CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY '';" | mysql -u root && \ + echo "GRANT ALL PRIVILEGES ON testdb.* TO 'wordpressuser'@'localhost' IDENTIFIED BY '';" | mysql -u root && \ + echo "FLUSH PRIVILEGES;" | mysql -u root -CMD sleep infinity & wait +CMD service php7.3-fpm start && \ + service mysql start && \ + service nginx start && \ + sleep infinity & wait -- cgit