From 6eb6249e55ef4a5d77c4617c288b280272550cd1 Mon Sep 17 00:00:00 2001 From: Marika Bertelli Date: Fri, 31 Jan 2025 14:05:22 +0000 Subject: [PATCH 1/5] 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 d8e483c19c5304da15df539ae014ddd186fa7c14 Mon Sep 17 00:00:00 2001 From: Marika Bertelli Date: Fri, 31 Jan 2025 14:07:08 +0000 Subject: [PATCH 2/5] 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 819706c5913041b5280c6983880a588452fe3aa1 Mon Sep 17 00:00:00 2001 From: Marika Bertelli Date: Fri, 31 Jan 2025 14:08:11 +0000 Subject: [PATCH 3/5] Update Dockerfile --- images/wordpress/Dockerfile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/images/wordpress/Dockerfile b/images/wordpress/Dockerfile index 30919b4..03c3666 100644 --- a/images/wordpress/Dockerfile +++ b/images/wordpress/Dockerfile @@ -32,5 +32,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 55a399abf3ffd1036ab1ca99507d653337739556 Mon Sep 17 00:00:00 2001 From: Marika Bertelli Date: Fri, 31 Jan 2025 14:15:54 +0000 Subject: [PATCH 4/5] 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 b9bff67c28a8ce04979643918662129913828a07 Mon Sep 17 00:00:00 2001 From: Marika Bertelli Date: Mon, 3 Feb 2025 14:26:17 +0000 Subject: [PATCH 5/5] 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 03c3666..ae5353c 100644 --- a/images/wordpress/Dockerfile +++ b/images/wordpress/Dockerfile @@ -33,12 +33,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 +