Add example of nginx+step-ca

This commit is contained in:
Mariano Cano 2018-11-09 17:27:36 -08:00
parent e0877a03f2
commit 30b30d7643
16 changed files with 248 additions and 0 deletions

View file

@ -0,0 +1,11 @@
FROM nginx:alpine
RUN apk add inotify-tools
RUN mkdir -p /var/local/step
COPY site.conf /etc/nginx/conf.d/
COPY certwatch.sh /
COPY entrypoint.sh /
# Cron && Nginx
ENTRYPOINT ["/entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]

View file

@ -0,0 +1,6 @@
#!/bin/sh
while true; do
inotifywait -e modify /var/local/step/site.crt
nginx -s reload
done

View file

@ -0,0 +1,10 @@
#!/bin/sh
# Wait for renewer
sleep 10
# watch for the update of the cert and reload nginx
/certwatch.sh &
# Run docker CMD
exec "$@"

View file

@ -0,0 +1,11 @@
server {
listen 443 ssl;
server_name localhost;
ssl_certificate /var/local/step/site.crt;
ssl_certificate_key /var/local/step/site.key;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
}