See: https://dockerwebdev.com/tutorials/docker-php-development/ to create root CA and the ssl cert:
Install mkcert (see: https://github.com/FiloSottile/mkcert)
Create the root CA (only once!):
mkcert -install
Create cert for localhost:
mkcert -cert-file ssl/cert.pem -key-file ssl/cert-key.pem localhost 127.0.0.1 ::1
Run:
docker-compose build && docker-compose up