trying to commit with my voyager is too complicated at the moment
This commit is contained in:
parent
778e1a9056
commit
4a60057513
10 changed files with 130 additions and 62 deletions
|
|
@ -1,10 +1,10 @@
|
|||
FROM alpine:3.21
|
||||
|
||||
RUN apk update && apk add bash wget php82 php82-phar php82-mysqli php82-fpm mariadb-client
|
||||
RUN apk update && apk add php82-curl php82-gd php82-mbstring php82-session php82-opcache php82-zlib bash wget php82 php82-phar php82-mysqli php82-fpm mariadb-client;
|
||||
|
||||
# RUN wget https://wordpress.org/latest.tar.gz -O /tmp/wp.tar.gz
|
||||
|
||||
RUN mkdir -p /var/www/html
|
||||
RUN mkdir -p /var/www/html;
|
||||
|
||||
RUN wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -O /bin/wp-cli.phar;
|
||||
RUN chmod +x /bin/wp-cli.phar;
|
||||
|
|
@ -12,10 +12,17 @@ RUN mv /bin/wp-cli.phar /bin/wp;
|
|||
|
||||
RUN ln -s /usr/bin/php82 /usr/bin/php;
|
||||
RUN ln -s /usr/sbin/php-fpm82 /usr/sbin/php-fpm;
|
||||
RUN export PHP_OPTIONS="-d memory_limit=512M"
|
||||
|
||||
RUN adduser -D wordpress -g wordpress;
|
||||
RUN chown wordpress:wordpress -R /var/www/html;
|
||||
RUN chmod -R +rw /var/www/html;
|
||||
RUN chmod -R +rw /var/log/php82/;
|
||||
|
||||
COPY tools/install.sh /usr/bin/install-wp
|
||||
RUN chmod +x /usr/bin/install-wp;
|
||||
|
||||
RUN chmod +x /usr/bin/install-wp
|
||||
COPY ./conf/php-fpm.conf /etc/php82/php-fpm.d/www.conf
|
||||
RUN sed -i 's/^memory_limit\s*=.*/memory_limit = 1024M/' /etc/php82/php.ini;
|
||||
USER wordpress
|
||||
|
||||
CMD ["install-wp", "php-fpm"]
|
||||
CMD ["install-wp"]
|
||||
|
|
|
|||
14
srcs/requirements/wordpress/conf/php-fpm.conf
Normal file
14
srcs/requirements/wordpress/conf/php-fpm.conf
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
[global]
|
||||
daemonize = false
|
||||
error_log = /dev/stderr
|
||||
|
||||
[www]
|
||||
listen = 0.0.0.0:9000
|
||||
|
||||
pm = dynamic
|
||||
pm.max_children = 25
|
||||
pm.start_servers = 5
|
||||
pm.min_spare_servers = 1
|
||||
pm.max_spare_servers = 10
|
||||
access.log = /dev/stderr
|
||||
catch_workers_output = yes
|
||||
|
|
@ -1,19 +1,12 @@
|
|||
#!/bin/sh
|
||||
set -xe
|
||||
mysqladmin --host=mariadb --port=3306 --user="$DB_USER" --password="$DB_PASSWORD" --wait status
|
||||
|
||||
cd /var/www/html
|
||||
|
||||
mariadb-admin --host=mariadb --port=3306 --user="$DB_USER" --password="$DB_PASS" --wait status
|
||||
|
||||
if ! [ -f wp-load.php ]; then
|
||||
if ! [ -e /var/www/html/wp-config.php ]; then
|
||||
wp core download --locale=fr_FR --allow-root --path=/var/www/html
|
||||
fi
|
||||
|
||||
if ! [ -f wp-config.php ]; then
|
||||
wp config create --dbname=$DB_NAME --dbuser=$DB_USER --dbpass=$DB_PASSWORD --dbhost=$DB_HOST --skip-check --path=/var/www/html --allow-root
|
||||
wp core install --url=$DOMAIN --title=$WP_TITLE --admin_user=$WP_ADMIN --admin_password=$WP_PASS_ADMIN --admin_email=$WP_MAIL_ADMIN --skip-email --path=/var/www/html --allow-root
|
||||
wp core install --url=$DOMAIN --title="$WP_TITLE" --admin_user=$WP_ADMIN --admin_password=$WP_PASS_ADMIN --admin_email=$WP_MAIL_ADMIN --path=/var/www/html --allow-root
|
||||
wp user create "$WP_USER" "$WP_MAIL" --user_pass="$WP_PASS" --role=editor --path=/var/www/html
|
||||
fi
|
||||
|
||||
chown wordpress:wordpress -R /var/www/html
|
||||
chmod -R +rw /var/www/html
|
||||
|
||||
exec php-fpm --nodeamonize
|
||||
exec php-fpm -F
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue