accounts/docker/nginx/generate-upstream.sh
ErickSkrauch f33439d829 Completely untie the backend from the frontend.
Build nginx and mariadb together with the app image.
Upgrade docker-compose configuration to 3 version.
Add cleanup step to the gitlab-ci.
2019-04-06 15:52:23 +02:00

16 lines
353 B
Bash
Executable File

#!/usr/bin/env sh
result="upstream php {"
for x in $(echo $PHP_SERVERS | tr "," "\n"); do
parts=$(echo $x | tr "x" "\n")
host=$(echo $parts | awk '{print $1}')
weight=$(echo $parts | awk '{print $2}')
result="$result\n server $host weight=${weight:-1};"
done
result="$result\n}"
echo -e $result > /etc/nginx/conf.d/upstream.conf