I'm a dumbass

This commit is contained in:
Pagwin 2023-09-15 16:41:29 -04:00
parent a4dc43452f
commit 9a5d99f9fc
No known key found for this signature in database
GPG key ID: F5FB283DD4B1A998
2 changed files with 3 additions and 1 deletions

View file

@ -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

View file

@ -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)