diff --git a/Dockerfile.alpine b/Dockerfile.alpine index b7443f0..2cf4d90 100644 --- a/Dockerfile.alpine +++ b/Dockerfile.alpine @@ -27,5 +27,14 @@ ENV DOCKER_HOST unix:///tmp/docker.sock VOLUME ["/etc/nginx/certs"] +ENV ACME_BUILD_DATE=2017-06-09 +ENV AUTO_UPGRADE=1 +ENV LE_WORKING_DIR=/acme.sh +ENV LE_CONFIG_HOME=/acmecerts +RUN wget -O- https://get.acme.sh | sh + +VOLUME ["/acmecerts"] +EXPOSE 443 + ENTRYPOINT ["/app/docker-entrypoint.sh"] CMD ["forego", "start", "-r"] diff --git a/Procfile b/Procfile index a96a1ab..09a8d50 100644 --- a/Procfile +++ b/Procfile @@ -1,3 +1,3 @@ dockergen: docker-gen -watch -notify "/app/updatessl.sh updatessl" /app/nginx.tmpl /etc/nginx/conf.d/default.conf nginx: nginx -cron: cron -f \ No newline at end of file +cron: cron -f || crond -f \ No newline at end of file diff --git a/updatessl.sh b/updatessl.sh index 559cfab..1581f83 100755 --- a/updatessl.sh +++ b/updatessl.sh @@ -11,7 +11,7 @@ CERTS="/etc/nginx/certs" updatessl() { - service nginx configtest && service nginx force-reload + nginx -t && nginx -s reload if grep ACME_DOMAINS $DEFAULT_CONF ; then for d_list in $(grep ACME_DOMAINS $DEFAULT_CONF | cut -d ' ' -f 2); do @@ -21,7 +21,7 @@ updatessl() { --nginx \ --fullchain-file "$CERTS/$d.crt" \ --key-file "$CERTS/$d.key" \ - --reloadcmd "service nginx configtest && service nginx force-reload" + --reloadcmd "nginx -t && nginx -s reload" done #generate nginx conf again. @@ -29,7 +29,7 @@ updatessl() { else echo "skip updatessl" fi - service nginx configtest && service nginx force-reload + nginx -t && nginx -s reload }