docker-ejabberd
docker-ejabberd copied to clipboard
dotenv and python
I learned a lot from this so thanks. Coincidentally I'm also templating an ejabberd project, but in regards to using it with keycloak. It was the templating that I searched and found this git.
Thought I might give a little back to cut down your code for templating. I too wanted to use a dotenv that I already have for docker, but didn't want to expand all my variables in my script. So I used python-dotenv
to modify your work.
readonly PYTHON_JINJA2="import os;
import sys;
import jinja2;
from dotenv import load_dotenv;
load_dotenv(verbose=True)
sys.stdout.write(
jinja2.Template
(sys.stdin.read()
).render(env=os.environ))"
No need to expand variables anymore.