Add example of nginx+step-ca
This commit is contained in:
parent
e0877a03f2
commit
30b30d7643
16 changed files with 248 additions and 0 deletions
11
examples/docker/nginx/Dockerfile
Normal file
11
examples/docker/nginx/Dockerfile
Normal 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;"]
|
6
examples/docker/nginx/certwatch.sh
Executable file
6
examples/docker/nginx/certwatch.sh
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
while true; do
|
||||
inotifywait -e modify /var/local/step/site.crt
|
||||
nginx -s reload
|
||||
done
|
10
examples/docker/nginx/entrypoint.sh
Executable file
10
examples/docker/nginx/entrypoint.sh
Executable 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 "$@"
|
11
examples/docker/nginx/site.conf
Normal file
11
examples/docker/nginx/site.conf
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue