We have been using ansible to set up application, but now we're moving to docker, so I have a question about generating sphinx.conf
(or any text file) from template.
I have template like this for jinja2 (which is supported in ansible):
{% for locale in locales %}
answers_{{ locale }}
{% endfor %}
And locales
var which is defined by locales: {"ru", "en", "de"}
So as a result i have:
answers_ru
answers_en
answers_de
Now is the question: what is the best way to do it using docker?
Found a solution using simple bash script, so I didn't even alter the template.
#!/bin/sh
cat > /etc/sphinxsearch/sphinx.conf
for LOCALE in ru en de ;
do
sed "s/{{ locale }}/${LOCALE}/g" ./template/index.conf.template >> /etc/sphinxsearch/sphinx.conf
done