wordpress: automatic setup

This commit is contained in:
starnakin 2023-10-05 12:13:38 -04:00
parent 231807c918
commit 71dc294248
2 changed files with 16 additions and 2 deletions

View File

@ -2,7 +2,7 @@ FROM alpine:3.17
RUN apk update 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/ RUN mkdir -p /var/www/
WORKDIR /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 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