initial commit
This commit is contained in:
34
srcs/requirements/wordpress/Dockerfile
Normal file
34
srcs/requirements/wordpress/Dockerfile
Normal file
@@ -0,0 +1,34 @@
|
||||
FROM debian:buster
|
||||
|
||||
RUN apt update -y
|
||||
RUN apt upgrade -y
|
||||
RUN apt-get install wget -y
|
||||
RUN apt-get install php7.3 -y
|
||||
RUN apt-get install php-fpm -y
|
||||
RUN apt-get install php-mysql -y
|
||||
RUN apt-get install mariadb-client -y
|
||||
RUN apt-get install less -y
|
||||
RUN wget https://fr.wordpress.org/latest-fr_FR.tar.gz -P /var/www
|
||||
#install all dependencies
|
||||
|
||||
RUN cd /var/www && tar -xzf latest-fr_FR.tar.gz && rm latest-fr_FR.tar.gz
|
||||
|
||||
COPY conf/www.conf /etc/php/7.3/fpm/pool.d
|
||||
# copy the config file in conf into the docker container
|
||||
|
||||
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.phar
|
||||
#download and install the CLI used in configscript.sh
|
||||
|
||||
RUN chown -R root:root /var/www/wordpress
|
||||
|
||||
COPY conf/configscript.sh configscript.sh
|
||||
#move the script from conf to the docker container
|
||||
|
||||
RUN chmod +x configscript.sh
|
||||
|
||||
EXPOSE 9000
|
||||
|
||||
ENTRYPOINT ["bash", "configscript.sh"]
|
||||
#start the script
|
||||
18
srcs/requirements/wordpress/conf/configscript.sh
Normal file
18
srcs/requirements/wordpress/conf/configscript.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
sleep 10
|
||||
#Waits for mariadb to be fully operational.
|
||||
if [ ! -e /var/www/wordpress/wp-config.php ]; then
|
||||
wp.phar config create --allow-root --dbname=$MYSQL_DATABASE --dbuser=$MYSQL_USER --dbpass=$MYSQL_PASSWORD --dbhost=mariadb:3306 --path='/var/www/wordpress'
|
||||
#Create the wp-config.php.
|
||||
wp.phar core install --allow-root --url=$URL --title=$WP_TITLE --admin_user=$WP_ADMIN_USER --admin_password=$WP_ADMIN_PASSWORD --admin_email=$WP_ADMIN_EMAIL --path='/var/www/wordpress'
|
||||
#install wordpress using the parameters and configs files.
|
||||
wp.phar user create --allow-root --role=author $USER_USER $USER_EMAIL --user_pass=$USER_PASSWORD --path='/var/www/wordpress'
|
||||
#create an user.
|
||||
|
||||
sleep 2
|
||||
fi
|
||||
if [ ! -d /run/php ]; then
|
||||
mkdir /run/php
|
||||
#create the php directory if it's not already created.
|
||||
fi
|
||||
/usr/sbin/php-fpm7.3 -F
|
||||
21
srcs/requirements/wordpress/conf/www.conf
Normal file
21
srcs/requirements/wordpress/conf/www.conf
Normal file
@@ -0,0 +1,21 @@
|
||||
[www]
|
||||
|
||||
user = www-data
|
||||
group = www-data
|
||||
|
||||
listen = wordpress:9000
|
||||
|
||||
listen.owner = www-data
|
||||
listen.group = www-data
|
||||
|
||||
pm = dynamic
|
||||
|
||||
pm.max_children = 5
|
||||
|
||||
pm.start_servers = 2
|
||||
|
||||
pm.min_spare_servers = 1
|
||||
|
||||
pm.max_spare_servers = 3
|
||||
|
||||
clear_env = no
|
||||
Reference in New Issue
Block a user