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 / {