diff --git a/srcs/wordpress/Dockerfile b/srcs/wordpress/Dockerfile index 4673036..3ef67fa 100644 --- a/srcs/wordpress/Dockerfile +++ b/srcs/wordpress/Dockerfile @@ -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"] diff --git a/srcs/wordpress/entrypoint.sh b/srcs/wordpress/entrypoint.sh new file mode 100644 index 0000000..7aa4133 --- /dev/null +++ b/srcs/wordpress/entrypoint.sh @@ -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