summaryrefslogtreecommitdiff
path: root/examples/nginx-alpine-ssl/entrypoint.sh
diff options
context:
space:
mode:
authorToby Jaffey <toby@ringtailsoftware.co.uk>2022-12-12 10:26:38 +0000
committerToby Jaffey <toby@ringtailsoftware.co.uk>2022-12-12 10:26:38 +0000
commit4afa513dced3b9ef024bc366b4fc884802730d50 (patch)
tree51098e478054a66439e98dfab89cbbedf5d9f5c0 /examples/nginx-alpine-ssl/entrypoint.sh
parentaa82e14bc7e7a3770feb23446d1a843d97213ccf (diff)
Add docker-compose support, so a working development server with HTTPS can be started with:
docker-compose build && docker-compose up
Diffstat (limited to 'examples/nginx-alpine-ssl/entrypoint.sh')
-rwxr-xr-xexamples/nginx-alpine-ssl/entrypoint.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/nginx-alpine-ssl/entrypoint.sh b/examples/nginx-alpine-ssl/entrypoint.sh
new file mode 100755
index 0000000..5432d46
--- /dev/null
+++ b/examples/nginx-alpine-ssl/entrypoint.sh
@@ -0,0 +1,15 @@
+cd /etc/nginx/http.d;
+export CRT="${CRT:=nginx-selfsigned.crt}";
+if [ -f "/etc/ssl/certs/$CRT" ]
+then
+ # set crt file in the default.conf file
+ sed -i "/ssl_certificate \//c\\\tssl_certificate \/etc\/ssl\/certs\/$CRT;" default.conf;
+fi
+export KEY="${KEY:=nginx-selfsigned.key}";
+if [ -f "/etc/ssl/private/$KEY" ]
+then
+ # set key file in the default.conf file
+ sed -i "/ssl_certificate_key \//c\\\tssl_certificate_key \/etc\/ssl\/private\/$KEY;" default.conf;
+fi
+nginx -g 'daemon off;'; nginx -s reload;
+