From 9a5d99f9fcf5e647e6deffdeb96c6b506075daba Mon Sep 17 00:00:00 2001 From: Pagwin Date: Fri, 15 Sep 2023 16:41:29 -0400 Subject: [PATCH] I'm a dumbass --- Dockerfile | 2 ++ scripts/template_convert.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 949e2ae..5e184fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,8 @@ ADD ./scripts/template_convert.py /application/template_convert.py ADD ./nginx.conf.template /application/nginx.conf.template WORKDIR /application USER application +ARG COMMENTS_BACKEND +ENV COMMENTS_BACKEND=${COMMENTS_BACKEND} RUN ["python", "/application/template_convert.py"] FROM nginx:1.25-alpine diff --git a/scripts/template_convert.py b/scripts/template_convert.py index 0015084..3764d08 100755 --- a/scripts/template_convert.py +++ b/scripts/template_convert.py @@ -14,7 +14,7 @@ if back == None: buf = re.sub("###{---(.|\n)*###---}", "", buf) else: # ${{\s*$var_name\s*}} - buf = re.sub(rf"\${{{{\s*{var_name}\s*}}}}",var_name,buf) + buf = re.sub(rf"\${{{{\s*{var_name}\s*}}}}",back,buf) with open(file_name, "w+") as file: file.write(buf)