From 565522bbdc9f3f20b19b0034b57ea3b1bea062c3 Mon Sep 17 00:00:00 2001 From: Marika Bertelli Date: Fri, 31 Jan 2025 14:05:22 +0000 Subject: [PATCH 1/6] Add apache configuration --- images/wordpress/apache-https.conf | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 images/wordpress/apache-https.conf 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 From 2a6e5db6364fa3a8a065078e4db74661bedad1b5 Mon Sep 17 00:00:00 2001 From: Marika Bertelli Date: Fri, 31 Jan 2025 14:07:08 +0000 Subject: [PATCH 2/6] Add openssl configuration --- images/wordpress/openssl.cnf | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 images/wordpress/openssl.cnf diff --git a/images/wordpress/openssl.cnf b/images/wordpress/openssl.cnf new file mode 100644 index 0000000..9220065 --- /dev/null +++ b/images/wordpress/openssl.cnf @@ -0,0 +1,8 @@ + [dn] +CN=localhost +[req] +distinguished_name = dn +[EXT] +subjectAltName=DNS:localhost +keyUsage=digitalSignature +extendedKeyUsage=serverAuth From 41118768b4ca34ec55418d29834643484b767465 Mon Sep 17 00:00:00 2001 From: Marika Bertelli Date: Fri, 31 Jan 2025 14:08:11 +0000 Subject: [PATCH 3/6] Update Dockerfile --- images/wordpress/Dockerfile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/images/wordpress/Dockerfile b/images/wordpress/Dockerfile index 10fef6f..720c322 100644 --- a/images/wordpress/Dockerfile +++ b/images/wordpress/Dockerfile @@ -34,5 +34,16 @@ 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 -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"] From 107ad2b99727d56cbde620d4017bbd33261bf973 Mon Sep 17 00:00:00 2001 From: Marika Bertelli Date: Fri, 31 Jan 2025 14:15:54 +0000 Subject: [PATCH 4/6] Update README with port 443 --- README.md | 1 + 1 file changed, 1 insertion(+) 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 From 17546e41d7a1bba94dd6c67590c2577e38e253f1 Mon Sep 17 00:00:00 2001 From: Marika Bertelli Date: Fri, 31 Jan 2025 17:19:39 +0000 Subject: [PATCH 5/6] Add self-certification configuration --- wpc | 1 + 1 file changed, 1 insertion(+) create mode 160000 wpc diff --git a/wpc b/wpc new file mode 160000 index 0000000..f875748 --- /dev/null +++ b/wpc @@ -0,0 +1 @@ +Subproject commit f87574872959432df96ea64bc757f8a9146c5184 From a8ef99a601e4c533e0a2881b5fb85088f7c8acf6 Mon Sep 17 00:00:00 2001 From: Marika Bertelli Date: Mon, 3 Feb 2025 14:26:17 +0000 Subject: [PATCH 6/6] Extend ssl-certificate expire date --- images/wordpress/Dockerfile | 4 +++- images/wordpress/openssl.cnf | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/images/wordpress/Dockerfile b/images/wordpress/Dockerfile index 720c322..ac1ad43 100644 --- a/images/wordpress/Dockerfile +++ b/images/wordpress/Dockerfile @@ -35,12 +35,14 @@ 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 -out /etc/ssl/certs/apache-localhost.crt \ +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 diff --git a/images/wordpress/openssl.cnf b/images/wordpress/openssl.cnf index 9220065..58eda60 100644 --- a/images/wordpress/openssl.cnf +++ b/images/wordpress/openssl.cnf @@ -1,8 +1,9 @@ - [dn] +[dn] CN=localhost [req] -distinguished_name = dn +distinguished_name = dn [EXT] subjectAltName=DNS:localhost keyUsage=digitalSignature extendedKeyUsage=serverAuth +