- This example is for Multi Domain SSL Setup.
- If you are planning for single domain, you can ignore 2nd docker/domain.
$ apt update
$ apt install certbot python3-certbot-nginx
$ docker network create web
docker build -t my-docker-app .
docker build -t my-docker-app2 .
docker run -d --name domain1.com --network web my-docker-app
docker run -d --name domain2.com --network web my-docker-app2
$ certbot -d domain1.com -d domain2.com
- Update the env.sh with your data
$ bash env.sh
$ docker run --name nginx --network web -p 80:80 -p 443:443 -v ./nginx.conf:/etc/nginx/nginx.conf -v /etc/letsencrypt/:/etc/letsencrypt/ nginx
-
- Update the domain name as per the image name
-
- Update the (SSL) certificate and key file location
-
- Mount nginx.conf and letsencrypt as virtual dir
-
- Test Image: shankarthiyagu/hello-world