add ssl for alpine
This commit is contained in:
parent
be8bb6e78a
commit
5af1bac769
3 changed files with 13 additions and 4 deletions
|
@ -27,5 +27,14 @@ ENV DOCKER_HOST unix:///tmp/docker.sock
|
||||||
|
|
||||||
VOLUME ["/etc/nginx/certs"]
|
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"]
|
ENTRYPOINT ["/app/docker-entrypoint.sh"]
|
||||||
CMD ["forego", "start", "-r"]
|
CMD ["forego", "start", "-r"]
|
||||||
|
|
2
Procfile
2
Procfile
|
@ -1,3 +1,3 @@
|
||||||
dockergen: docker-gen -watch -notify "/app/updatessl.sh updatessl" /app/nginx.tmpl /etc/nginx/conf.d/default.conf
|
dockergen: docker-gen -watch -notify "/app/updatessl.sh updatessl" /app/nginx.tmpl /etc/nginx/conf.d/default.conf
|
||||||
nginx: nginx
|
nginx: nginx
|
||||||
cron: cron -f
|
cron: cron -f || crond -f
|
|
@ -11,7 +11,7 @@ CERTS="/etc/nginx/certs"
|
||||||
|
|
||||||
|
|
||||||
updatessl() {
|
updatessl() {
|
||||||
service nginx configtest && service nginx force-reload
|
nginx -t && nginx -s reload
|
||||||
if grep ACME_DOMAINS $DEFAULT_CONF ; then
|
if grep ACME_DOMAINS $DEFAULT_CONF ; then
|
||||||
for d_list in $(grep ACME_DOMAINS $DEFAULT_CONF | cut -d ' ' -f 2);
|
for d_list in $(grep ACME_DOMAINS $DEFAULT_CONF | cut -d ' ' -f 2);
|
||||||
do
|
do
|
||||||
|
@ -21,7 +21,7 @@ updatessl() {
|
||||||
--nginx \
|
--nginx \
|
||||||
--fullchain-file "$CERTS/$d.crt" \
|
--fullchain-file "$CERTS/$d.crt" \
|
||||||
--key-file "$CERTS/$d.key" \
|
--key-file "$CERTS/$d.key" \
|
||||||
--reloadcmd "service nginx configtest && service nginx force-reload"
|
--reloadcmd "nginx -t && nginx -s reload"
|
||||||
done
|
done
|
||||||
|
|
||||||
#generate nginx conf again.
|
#generate nginx conf again.
|
||||||
|
@ -29,7 +29,7 @@ updatessl() {
|
||||||
else
|
else
|
||||||
echo "skip updatessl"
|
echo "skip updatessl"
|
||||||
fi
|
fi
|
||||||
service nginx configtest && service nginx force-reload
|
nginx -t && nginx -s reload
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue