sebastiantecsi / docker-https

Provides an example of how to setup a certificate on a local development machine and the docker container.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker with HTTPS

This repository provides an example on how to configure a website running in IIS hosted in Docker to make use of a certificate.

Setup

There are a few things to have in place when getting started.

  • Docker images built for use with the docker-compose.yml. The version included assumes images built for Sitecore are used.
  • The createcert.ps1 is run on the workstation with elevated privileges. The files cert.password.txt and cert.pfx are created in the startup directory and copied to the container on startup.
    • Usages: ./createcert.ps1
    • Usages: ./createcert.ps1 -dnsNameList "*.dev.com"
    • Usages: ./createcert.ps1 -dnsNameList "*.dev.com", "*.dev2.com", "*.devn.com"

Customize

If you wish to change the entrypoint script you can do the following:

Set Entrypoint:

entrypoint: powershell.exe -NoLogo -NoProfile -Command "& C:\\startup\\startup.ps1 -EntryPointScriptPath 'C:\\customtools\\Development.ps1'"

Set Volume (optional):

volumes:
  - .\customtools:C:\customtools

Running

From your favorite console run the following command:

docker-compose up

The "monitor" service is designed to edit the hosts file when a service spins up. In our case we want the host header for the custom website to be added. The example host header used in this repo is docker-https.dev.local.

Defaults

  • Certificate uses a wildcard *.dev.local.
  • Host header defined in the Docker compose file is docker-https.dev.local

image

About

Provides an example of how to setup a certificate on a local development machine and the docker container.

License:MIT License


Languages

Language:PowerShell 100.0%