This is full project structure example of article How to dockerize your static website with Nginx, automatic renew SSL for domain by Certbot and deploy it to DigitalOcean?
Published on Dev.to @ 27 Jan 2020.
- Docker
19.x+
- Clone this repository and go to folder:
git clone https://github.com/koddr/example-static-website-docker-nginx-certbot.git
cd example-static-website-docker-nginx-certbot
- Change
site.com
to your domain at files:
./docker-compose.prod.yml
./webserver/nginx/default.conf
./webserver/nginx/site.com.conf
- Push configured project to your own git repository.
- Go to DigitalOcean account, create and configure new droplet (see screenshots in article).
- Connect via SSH to your droplet and
git clone
your repo. - Check configuration of
Certbot
, start the process of obtaining SSL certificate in test mode:
make certbot-test DOMAINS="site.com www.site.com" [email protected]
- If you see
Congratulations!
, all okay; start the process of obtaining SSL in production mode:
make certbot-prod DOMAINS="site.com www.site.com" [email protected]
- And now, check Nginx config:
make deploy-test
- No errors? Go your static website to production:
make deploy-prod
- That's all!
- Vic Shóstak (aka Koddr).
If you want to say «thank you»:
- Twit about article on your Twitter.
- Add a GitHub Star and make Fork to this repository.
- Donate some money to project author via PayPal: @paypal.me/koddr or LiberaPay.
- Join DigitalOcean at our referral link (your profit is $100 and we get $25).
Thanks for your support! 😘
MIT