Skip to content

arthurbdiniz/docker-letsencrypt-nginx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Letsencrypt Docker

Simple tutorial that show how to deploy services in a practical way using docker, nginx and letsencrypt.

How to run

  1. Replace example.org with your domain name and the server ip/port
# data/nginx/app.conf
upstream whoami {
    server 10.0.0.10:8000;
}

server_name example.org;

ssl_certificate /etc/letsencrypt/live/example.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.org/privkey.pem;
# init-letsencryptinit-letsencrypt
domains=(example.org)
  1. Create a dummy certificate
chmod +x init-letsencrypt.sh
sudo ./init-letsencrypt.sh
  1. Automatic Certificate Renewal To activate auto renew uncoment the following lines on docker-compose.yml file:

Nginx service

# command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"

Certbot service

# entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
  1. Everything is in place now. The initial certificates have been obtained and our containers are ready to launch. Simply run docker-compose up and enjoy your HTTPS-secured website or app.
docker-compose up

About

Letsencrypt deploy for docker-compose using nginx

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages