Skip to main content

Use SSL

Install mkcert

Follow the instructions on the mkcert website to install mkcert.

Create a self-signed certificate

In the .docker folder, create a folder called certs and create a self-signed certificate.

mkcert "*.dev.local"

Rename the files to dev.local.crt and dev.local.key

Configure apache

Create a configuration file in the .docker/etc folder called httpd-vhosts.conf if it doesn't exist.

.docker/etc/httpd-vhosts.conf
<VirtualHost *:443>
# ... Conf

SSLEngine on

SSLCertificateFile /var/www/.docker/certs/dev.local.crt
SSLCertificateKeyFile /var/www/.docker/certs/dev.local.key
SSLVerifyClient none

</VirtualHost>

If the file was not already created, you probably does not have any existing volumes, then add the following line to the docker-compose file.

.docker/docker-compose.yml
services:
# ... Services
apache:
# ... Apache
volumes:
# ... Volumes
- ${PROJECT_ROOT}/.docker/etc/apache/httpd-vhosts.conf:/usr/local/apache2/conf/extra/httpd-vhosts.conf