feat: add app files

This commit is contained in:
Lenoctambule
2026-04-02 12:04:23 +02:00
parent e3f5cf6a1e
commit f8a48ee181
13 changed files with 524 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
#!/bin/bash
function gen_wpconfig()
{
echo "<?php define( 'DB_NAME', 'wp_db' );" >> wp-config.php
echo "define( 'DB_USER', '$DB_USER' );" >> wp-config.php
echo "define( 'DB_PASSWORD', '$DB_PWD' );" >> wp-config.php
echo "define( 'DB_HOST', 'mariadb' );" >> wp-config.php
echo "define( 'DB_CHARSET', 'utf8' );" >> wp-config.php
echo "define( 'DB_COLLATE', '' );" >> wp-config.php
echo "define( 'WP_DEBUG', false );" >> wp-config.php
echo '$table_prefix = '"'wp_'"';' >> wp-config.php
curl https://api.wordpress.org/secret-key/1.1/salt/ >> wp-config.php
echo "if ( ! defined( 'ABSPATH' ) ) { define( 'ABSPATH', __DIR__ . '/' ); }" >> wp-config.php
echo "require_once ABSPATH . 'wp-settings.php';" >> wp-config.php
}
cd /var/www/wordpress
wp core download --allow-root
if [ ! -f wp-config.php ]; then
gen_wpconfig
fi
wp core install --url="https://rralambo.42.fr" \
--title="Le Noctambule Co." \
--admin_email=$WP_ADMIN_EMAIL \
--admin_user=$WP_ADMIN \
--admin_password=$WP_ADMIN_PWD \
--allow-root
wp user create $WP_USER $WP_EMAIL --user_pass=$WP_PWD --role=author --allow-root
echo '[Starting PHP-FPM]'
php-fpm7.4 -F -y /wordpress.conf