mirror of
https://github.com/weaveworks/scope.git
synced 2026-08-18 03:46:45 +00:00
Update example app to include a loadbalancer.
This commit is contained in:
+13
-10
@@ -2,24 +2,27 @@
|
||||
|
||||
set -eux
|
||||
|
||||
REPLICAS=${REPLICAS:-1}
|
||||
eval $(weave env)
|
||||
|
||||
start_container() {
|
||||
IMAGE=$1
|
||||
BASENAME=${2:-$1}
|
||||
IMAGE=$2
|
||||
BASENAME=$3
|
||||
REPLICAS=$1
|
||||
shift 3
|
||||
HOSTNAME=$BASENAME.weave.local
|
||||
|
||||
for i in $(seq $REPLICAS); do
|
||||
if docker inspect $BASENAME$i >/dev/null 2>&1; then
|
||||
docker rm -f $BASENAME$i
|
||||
fi
|
||||
weave run --with-dns --name=$BASENAME$i --hostname=$HOSTNAME $IMAGE
|
||||
docker run -d --name=$BASENAME$i --hostname=$HOSTNAME $@ $IMAGE
|
||||
done
|
||||
}
|
||||
|
||||
start_container elasticsearch
|
||||
start_container tomwilkie/searchapp searchapp
|
||||
start_container redis
|
||||
start_container tomwilkie/qotd qotd
|
||||
start_container tomwilkie/app app
|
||||
start_container tomwilkie/client client
|
||||
start_container 1 elasticsearch elasticsearch
|
||||
start_container 2 tomwilkie/searchapp searchapp
|
||||
start_container 1 redis redis
|
||||
start_container 1 tomwilkie/qotd qotd
|
||||
start_container 2 tomwilkie/app app
|
||||
start_container 2 tomwilkie/frontend frontend --add-host=dns.weave.local:$(weave docker-bridge-ip)
|
||||
start_container 1 tomwilkie/client client
|
||||
|
||||
Reference in New Issue
Block a user