Compare commits

...

2 Commits

Author SHA1 Message Date
ed3195f536 add: mariadb 2023-10-05 12:14:12 -04:00
71dc294248 wordpress: automatic setup 2023-10-05 12:13:38 -04:00
4 changed files with 28 additions and 2 deletions

10
srcs/mariadb/Dockerfile Normal file
View File

@ -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"]

2
srcs/mariadb/init.sql Normal file
View File

@ -0,0 +1,2 @@
CREATE DATABASE wordpress;
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'%' IDENTIFIED BY 'wordpress';

View File

@ -2,7 +2,7 @@ FROM alpine:3.17
RUN apk update
RUN apk add mysql-client php php-fpm php-mysqli
RUN apk add php php-phar php-fpm php-mysqli php-iconv mysql-client php-json php-curl php-dom php-exif php-fileinfo php-mbstring php-openssl php-xml php-zip php-tokenizer php-session
RUN mkdir -p /var/www/
WORKDIR /var/www/
@ -12,4 +12,11 @@ RUN rm latest.tar.gz
RUN sed -i "s/^listen.*/listen = 9000/" /etc/php81/php-fpm.d/www.conf
ENTRYPOINT ["php-fpm81", "-F"]
WORKDIR wordpress
RUN wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
RUN chmod +x wp-cli.phar
RUN mv wp-cli.phar /usr/local/bin/wp
COPY entrypoint.sh /
ENTRYPOINT ["sh", "/entrypoint.sh"]

View File

@ -0,0 +1,7 @@
wp config create --dbname=wordpress --dbuser=$DB_USER --dbpass=$DB_PASS --dbhost=mariadb
wp core install --url=cchauvet.42.fr --title=BOZOLAND --admin_user=$WP_ADMIN_USER --admin_password=$WP_ADMIN_PASS --admin_email=$WP_ADMIN_USER@email.com
wp user create $WP_USER $WP_USER@email.com --user_pass=$WP_PASS
exec php-fpm81 -F