- Create a self-signed certificate
- Install certificates
- Configure the services
From WSL, run the create-docker-certificate.sh script with a strong password for the certificate.
./create-docker-certificate.sh "secure-COMPLEX-and-SECRET-password"The script creates a certificate for both host.docker.internal and localhost.
Run the install-docker-certificate.ps1 with the same password you used above:
.\install-docker-certificate.ps1 "secure-COMPLEX-and-SECRET-password"The above script:
- Imports the certificate in the current user root CA store.
- Copies the certificate files to the
%USERPROFILE%\.aspnet\httpsfolder. Servers will serve the certificate from this folder. - Copies the
.pemfile as.crtto the src\certificates folder to add it as a root CA when building the images for some services.
- Copy the
src\docker-compose.certificates.sample.ymlfile assrc\docker-compose.certificates.yml - Configure the password you assigned to the certificates in the settings
ASPNETCORE_Kestrel__Certificates__Default__Password
IMPORTANT
The
src\docker-compose.certificates.yamlfile is .gitignore'd to avoid pushing it to the repo with the certificate password.To avoid security risks, DON'T FORCE PUSH the file.