Docker-compose file for setting up nginx & letsencrypt that combines docker command line setup for both containers on nginx-proxy and nginx-proxy-companion
Make sure your DNS accepts CAA record for letsencrypt
CAA
0 issue letsencrypt.org
Replace the DEFAULT_EMAIL and network name variables in docker-compose.yml with your own.
Setup the docker container
docker-compose up -d
Make sure the networked containers contain the following environment variables:
VIRTUAL_HOST=YOUR_DOMAIN.TLD
LETSENCRYPT_HOST=YOUR_DOMAIN.TLD
Nginx should correctly reverse proxy requested urls to the corresponding application container.