Add multi_coop configuration via environment variable in docker setup
If the file app_config.defaults.yml exists in the working directory, the content will be written to the config/app_config.yml and appended by a configuration entry for every foodcoop in the space separated environment variable FOODSOFT_FOODCOOPS.
This commit is contained in:
parent
ae11931ca5
commit
a0d4fad4d8
2 changed files with 16 additions and 2 deletions
|
|
@ -6,4 +6,17 @@ if [ -f tmp/pids/server.pid ]; then
|
|||
rm tmp/pids/server.pid
|
||||
fi
|
||||
|
||||
if [ -e app_config.defaults.yml ] ; then
|
||||
cat app_config.defaults.yml > config/app_config.yml
|
||||
|
||||
for FOODCOOP in $FOODSOFT_FOODCOOPS; do
|
||||
cat << EOF >> config/app_config.yml
|
||||
$FOODCOOP:
|
||||
<<: *defaults
|
||||
database:
|
||||
database: foodsoft_$FOODCOOP
|
||||
EOF
|
||||
done
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue