From 31b03da98f5f42e0c554e71fb50bc96d9fffef10 Mon Sep 17 00:00:00 2001 From: Salah Al Saleh Date: Mon, 18 Mar 2024 11:55:31 -0700 Subject: [PATCH] Put back entrypoint (#149) --- nginx/Dockerfile | 5 +++++ nginx/entrypoint.sh | 7 +++++++ nginx/nginx.conf | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 nginx/entrypoint.sh diff --git a/nginx/Dockerfile b/nginx/Dockerfile index ec14da8..37bd5fd 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -5,3 +5,8 @@ COPY nginx.conf /etc/nginx/nginx.conf COPY src/favicon.ico /usr/share/nginx/html/ COPY src/index.htm /usr/share/nginx/html/ COPY src/ttlsh_files /usr/share/nginx/html/ttlsh_files/ + +ADD entrypoint.sh /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/nginx/entrypoint.sh b/nginx/entrypoint.sh new file mode 100644 index 0000000..4616af1 --- /dev/null +++ b/nginx/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +sed -i "s/__PORT__/$PORT/g" /etc/nginx/nginx.conf + +exec "$@" diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 1cc68b6..faef580 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -11,7 +11,7 @@ http { } server { - listen <%= ENV["PORT"] %>; + listen __PORT__; server_name _; location / {