Compare commits
2 Commits
231807c918
...
ed3195f536
Author | SHA1 | Date | |
---|---|---|---|
ed3195f536 | |||
71dc294248 |
10
srcs/mariadb/Dockerfile
Normal file
10
srcs/mariadb/Dockerfile
Normal 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
2
srcs/mariadb/init.sql
Normal file
@ -0,0 +1,2 @@
|
||||
CREATE DATABASE wordpress;
|
||||
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'%' IDENTIFIED BY 'wordpress';
|
@ -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"]
|
||||
|
7
srcs/wordpress/entrypoint.sh
Normal file
7
srcs/wordpress/entrypoint.sh
Normal 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
|
Loading…
Reference in New Issue
Block a user