diff --git a/README.md b/README.md index bd8d7fe..8d7131d 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ Example `docker-compose.yml` file (the last two lines should be added - the rest image: thedxw/wpc-wordpress ports: - "80:80" + - "443:443" links: - mysql - mailcatcher diff --git a/images/wordpress/Dockerfile b/images/wordpress/Dockerfile index 30919b4..ac1ad43 100644 --- a/images/wordpress/Dockerfile +++ b/images/wordpress/Dockerfile @@ -1,11 +1,10 @@ -FROM php:7.4-apache +FROM php:8.2-apache RUN apt-get update && apt-get install -y --no-install-recommends clamav libmagickwand-dev libjpeg-dev libpng-dev vim-tiny less mariadb-client libgmp-dev libsodium-dev zlib1g-dev libzip-dev && rm -r /var/lib/apt/lists/* && freshclam RUN pecl install imagick -RUN docker-php-ext-install mysqli && \ - docker-php-ext-install gd && \ +RUN docker-php-ext-install gd && \ docker-php-ext-install gmp && \ docker-php-ext-install sodium && \ docker-php-ext-install zip && \ @@ -16,6 +15,9 @@ RUN docker-php-ext-install mysqli && \ docker-php-ext-install exif &&\ docker-php-ext-install soap &&\ docker-php-ext-enable imagick && \ + docker-php-ext-install pdo pdo_mysql &&\ + docker-php-ext-install mysqli && \ + docker-php-ext-enable mysqli && \ a2enmod rewrite RUN curl --silent https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar > /usr/local/bin/wp-cli.phar @@ -32,5 +34,18 @@ COPY wordpress.conf /etc/apache2/sites-enabled/ COPY mu-plugins /usr/src/mu-plugins/ COPY wp-config.php /var/www/html/wp-config.php +COPY openssl.cnf /etc/ssl/openssl.cnf +RUN openssl req -x509 -days 3650 -out /etc/ssl/certs/apache-localhost.crt \ + -keyout /etc/ssl/private/apache-localhost.key \ + -newkey rsa:2048 -nodes -sha256 \ + -subj '/CN=localhost' \ + -extensions EXT \ + -config /etc/ssl/openssl.cnf + + +COPY apache-https.conf /etc/apache2/sites-available/ +RUN a2enmod ssl +RUN a2ensite apache-https + ENTRYPOINT ["wp-start"] CMD ["apache2-foreground"] diff --git a/images/wordpress/apache-https.conf b/images/wordpress/apache-https.conf new file mode 100644 index 0000000..98ffda8 --- /dev/null +++ b/images/wordpress/apache-https.conf @@ -0,0 +1,8 @@ + + DocumentRoot "/var/www/html" + ServerName localhost + + SSLEngine on + SSLCertificateFile "/etc/ssl/certs/apache-localhost.crt" + SSLCertificateKeyFile "/etc/ssl/private/apache-localhost.key" + \ No newline at end of file diff --git a/images/wordpress/openssl.cnf b/images/wordpress/openssl.cnf new file mode 100644 index 0000000..58eda60 --- /dev/null +++ b/images/wordpress/openssl.cnf @@ -0,0 +1,9 @@ +[dn] +CN=localhost +[req] +distinguished_name = dn +[EXT] +subjectAltName=DNS:localhost +keyUsage=digitalSignature +extendedKeyUsage=serverAuth + diff --git a/wpc b/wpc new file mode 160000 index 0000000..f875748 --- /dev/null +++ b/wpc @@ -0,0 +1 @@ +Subproject commit f87574872959432df96ea64bc757f8a9146c5184