Skip to content

Commit

Permalink
fix busy resource, switch to certbot
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed Oct 19, 2016
1 parent 390e1e4 commit 36029c7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
etc/ssl/
4 changes: 2 additions & 2 deletions Dockerfile
@@ -1,4 +1,4 @@
FROM nginx:stable-alpine
FROM nginx:1.10-alpine

ADD conf/nginx.conf /etc/nginx/nginx.conf
#ADD conf/service.conf /etc/nginx/conf.d/service.conf
Expand All @@ -9,7 +9,7 @@ ADD script/le.sh /le.sh
RUN \
chmod +x /entrypoint.sh && \
chmod +x /le.sh && \
apk add --update letsencrypt tzdata openssl && \
apk add --update certbot tzdata openssl && \
rm -rf /var/cache/apk/*

CMD ["/entrypoint.sh"]
2 changes: 1 addition & 1 deletion docker-compose.yml
Expand Up @@ -16,7 +16,7 @@ services:

volumes:
- ./etc/ssl:/etc/nginx/ssl
- ./etc/service-example.conf:/etc/nginx/conf.d/service.conf
- ./etc/service-example.conf:/etc/nginx/service.conf

ports:
- "80:80"
Expand Down
1 change: 1 addition & 0 deletions script/entrypoint.sh
Expand Up @@ -10,6 +10,7 @@ echo $TZ > /etc/timezone && \
echo "ssl_key=${SSL_KEY:=le-key.pem}, ssl_cert=${SSL_CERT:=le-crt.pem}"
SSL_KEY=/etc/nginx/ssl/${SSL_KEY}
SSL_CERT=/etc/nginx/ssl/${SSL_CERT}
cp -f /etc/nginx/service.conf /etc/nginx/conf.d/service.conf
sed -i "s|SSL_KEY|${SSL_KEY}|g" /etc/nginx/conf.d/service.conf
sed -i "s|SSL_CERT|${SSL_CERT}|g" /etc/nginx/conf.d/service.conf

Expand Down
2 changes: 1 addition & 1 deletion script/le.sh
@@ -1,7 +1,7 @@
#!/bin/sh

if [ "$LETSENCRYPT" = "true" ]; then
letsencrypt certonly -t -n --agree-tos --renew-by-default --email "${LE_EMAIL}" --webroot -w /usr/share/nginx/html -d $LE_FQDN
certbot certonly -t -n --agree-tos --renew-by-default --email "${LE_EMAIL}" --webroot -w /usr/share/nginx/html -d $LE_FQDN
cp -fv /etc/letsencrypt/live/$LE_FQDN/privkey.pem /etc/nginx/ssl/le-key.pem
cp -fv /etc/letsencrypt/live/$LE_FQDN/fullchain.pem /etc/nginx/ssl/le-crt.pem
else
Expand Down

0 comments on commit 36029c7

Please sign in to comment.