BIENTOT
This commit is contained in:
@@ -1,32 +1,33 @@
|
||||
FROM debian:bullseye
|
||||
FROM debian:11
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
mariadb-client \
|
||||
curl \
|
||||
php7.4-fpm \
|
||||
php7.4-mysql \
|
||||
php7.4-cli \
|
||||
php7.4-curl \
|
||||
php7.4-gd \
|
||||
php7.4-mbstring \
|
||||
php7.4-xml \
|
||||
php7.4-zip \
|
||||
&& apt-get clean
|
||||
|
||||
RUN apt-get update -y && \
|
||||
apt-get upgrade -y && \
|
||||
apt-get install -y php7.4 php-fpm php-cli php-mysql mariadb-client curl
|
||||
# Fix: créer le dossier /run/php
|
||||
RUN mkdir -p /run/php
|
||||
|
||||
RUN mkdir /run/php
|
||||
|
||||
RUN mkdir -p /var/www/html/
|
||||
|
||||
RUN chown -R www-data:www-data /var/www/html
|
||||
|
||||
RUN curl -O 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 www.conf /etc/php/7.4/fpm/pool.d/www.conf
|
||||
|
||||
COPY tools/wordpress.sh /wordpress.sh
|
||||
|
||||
RUN chmod +x /wordpress.sh
|
||||
|
||||
EXPOSE 9000
|
||||
# Fix: forcer php-fpm à écouter sur le port 9000
|
||||
RUN sed -i 's|listen = /run/php/php7.4-fpm.sock|listen = 9000|' /etc/php/7.4/fpm/pool.d/www.conf
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
ENTRYPOINT ["/bin/bash", "/wordpress.sh"]
|
||||
RUN curl -o wordpress.tar.gz https://wordpress.org/latest.tar.gz && \
|
||||
tar -xzf wordpress.tar.gz --strip-components=1 && \
|
||||
rm wordpress.tar.gz
|
||||
|
||||
COPY conf/wp-config.php /var/www/html/wp-config.php
|
||||
|
||||
EXPOSE 9000
|
||||
|
||||
CMD ["/usr/sbin/php-fpm7.4", "-F"]
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
define( 'DB_NAME', getenv('MYSQL_DATABASE') );
|
||||
|
||||
define( 'DB_USER', trim(file_get_contents(getenv('MYSQL_USER_FILE'))) );
|
||||
define( 'DB_PASSWORD', trim(file_get_contents(getenv('MYSQL_PASSWORD_FILE'))) );
|
||||
|
||||
define( 'DB_HOST', 'mariadb' );
|
||||
define( 'DB_CHARSET', 'utf8mb4' );
|
||||
define( 'DB_COLLATE', '' );
|
||||
|
||||
$table_prefix = 'wp_';
|
||||
define( 'WP_DEBUG', false );
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
define( 'ABSPATH', __DIR__ . '/' );
|
||||
}
|
||||
|
||||
require_once ABSPATH . 'wp-settings.php';
|
||||
@@ -1,23 +0,0 @@
|
||||
[www]
|
||||
|
||||
user = www-data
|
||||
|
||||
group = www-data
|
||||
|
||||
listen = 0.0.0.0: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
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ ! -f ./wp-config.php ]; then
|
||||
|
||||
wp core download --allow-root
|
||||
|
||||
|
||||
wp config create --dbname=$SQL_DATABSE --dbuser=$SQL_USER --dbpass=$SQL_PASSWORD --dbhost=mariadb --allow-root
|
||||
|
||||
wp core install --url=$DOMAIN_NAME --title="$WP_TITLE" --admin_user=$WP_ADMIN_USER --admin_password=$WP_ADMIN_PASSWORD --admin_email=$WP_ADMIN_EMAIL --allow-root
|
||||
|
||||
wp user create $WP_NORMAL_USER $WP_NORMAL_USER_EMAIL --user_pass=$WP_NORMAL_USER_PASSWORD --role=author --allow-root
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user