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..ae5353c 100644 --- a/images/wordpress/Dockerfile +++ b/images/wordpress/Dockerfile @@ -32,5 +32,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 +