Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions images/wordpress/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
8 changes: 8 additions & 0 deletions images/wordpress/apache-https.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<VirtualHost *:443>
DocumentRoot "/var/www/html"
ServerName localhost

SSLEngine on
SSLCertificateFile "/etc/ssl/certs/apache-localhost.crt"
SSLCertificateKeyFile "/etc/ssl/private/apache-localhost.key"
</VirtualHost>
9 changes: 9 additions & 0 deletions images/wordpress/openssl.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[dn]
CN=localhost
[req]
distinguished_name = dn
[EXT]
subjectAltName=DNS:localhost
keyUsage=digitalSignature
extendedKeyUsage=serverAuth