1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-16 03:48:44 +00:00

rename letsencrypt to certbot

This commit is contained in:
kev 2016-07-29 14:51:39 +08:00
parent c38920eb8d
commit 7f300261f2
4 changed files with 32 additions and 20 deletions

@ -209,6 +209,7 @@ A collection of delicious docker recipes.
## 3rd-party ## 3rd-party
- [x] centurylink/watchtower - [x] centurylink/watchtower
- [x] certbot
- [x] drone/drone - [x] drone/drone
- [x] drupal - [x] drupal
- [x] ghost - [x] ghost
@ -223,7 +224,6 @@ A collection of delicious docker recipes.
- [x] jazzdd/phpvirtualbox - [x] jazzdd/phpvirtualbox
- [x] jenkins - [x] jenkins
- [x] jupyter/notebook - [x] jupyter/notebook
- [x] letsencrypt
- [x] mongo - [x] mongo
- [x] neo4j - [x] neo4j
- [x] owncloud - [x] owncloud

@ -1,5 +1,5 @@
letsencrypt certbot
=========== =======
[Lets Encrypt][1] is a new Certificate Authority: [Lets Encrypt][1] is a new Certificate Authority:
Its free, automated, and open. Its free, automated, and open.
@ -7,15 +7,15 @@ Its free, automated, and open.
## docker-compose.yml ## docker-compose.yml
``` ```
letsencrypt: certbot:
image: quay.io/letsencrypt/letsencrypt image: quay.io/letsencrypt/letsencrypt
command: auth command: certonly --standalone
ports: ports:
- "80:80" - "80:80"
- "443:443" - "443:443"
volumes: volumes:
- "./etc/letsencrypt:/etc/letsencrypt" - /etc/letsencrypt:/etc/letsencrypt
- "./var/lib/letsencrypt:/var/lib/letsencrypt" - /var/lib/letsencrypt:/var/lib/letsencrypt
``` ```
## up and running ## up and running
@ -24,15 +24,27 @@ letsencrypt:
# stop nginx (release 80/tcp and 443/tcp) # stop nginx (release 80/tcp and 443/tcp)
$ systemctl stop nginx $ systemctl stop nginx
# generate keys # generate keys (interactive)
$ docker-compose run --rm --service-ports letsencrypt $ docker-compose run --rm --service-ports certbot
>>> email: admin@easypi.info >>> email: admin@easypi.info
>>> domains: easypi.info,blog.easypi.info,wiki.easypi.info >>> domains: easypi.info,blog.easypi.info,wiki.easypi.info
# renew keys (headless)
$ docker-compose run --rm --service-ports certbot renew
# list keys
$ tree /etc/letsencrypt/live/
/etc/letsencrypt/live/
└── easypi.info
├── cert.pem -> ../../archive/easypi.info/cert1.pem
├── chain.pem -> ../../archive/easypi.info/chain1.pem
├── fullchain.pem -> ../../archive/easypi.info/fullchain1.pem
└── privkey.pem -> ../../archive/easypi.info/privkey1.pem
# deploy keys # deploy keys
$ mkdir -p /etc/nginx/ssl/ $ mkdir -p /etc/nginx/ssl/
$ cp ./etc/letsencrypt/live/easypi.info/fullchain.pem /etc/nginx/ssl/easypi.info.crt $ cp /etc/letsencrypt/live/easypi.info/fullchain.pem /etc/nginx/ssl/easypi.info.crt
$ cp ./etc/letsencrypt/live/easypi.info/privkey.pem /etc/nginx/ssl/easypi.info.key $ cp /etc/letsencrypt/live/easypi.info/privkey.pem /etc/nginx/ssl/easypi.info.key
# reconfig nginx # reconfig nginx
$ vi /etc/nginx/sites-enabled/default $ vi /etc/nginx/sites-enabled/default

@ -0,0 +1,9 @@
certbot:
image: quay.io/letsencrypt/letsencrypt
command: certonly --standalone
ports:
- "80:80"
- "443:443"
volumes:
- /etc/letsencrypt:/etc/letsencrypt
- /var/lib/letsencrypt:/var/lib/letsencrypt

@ -1,9 +0,0 @@
letsencrypt:
image: quay.io/letsencrypt/letsencrypt
command: auth
ports:
- "80:80"
- "443:443"
volumes:
- "./etc/letsencrypt:/etc/letsencrypt"
- "./var/lib/letsencrypt:/var/lib/letsencrypt"