Make cross-container access work
[aaf/authz.git] / auth / docker / drun.sh
1 #!/bin/bash drun.sh
2 . d.props
3
4 if [ "$1" == "" ]; then
5   AAF_COMPONENTS=`ls -r ../aaf_${VERSION}/bin | grep -v '\.'`
6 else
7   AAF_COMPONENTS=$1
8 fi
9   
10 for AAF_COMPONENT in ${AAF_COMPONENTS}; do 
11         case "$AAF_COMPONENT" in
12                 "service") 
13                         PORTMAP="8100:8100"
14                         LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST" 
15                         ;;
16                 "locate") 
17                         PORTMAP="8095:8095"
18                         LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST" 
19                         ;;
20                 "oauth") 
21                         PORTMAP="8140:8140"
22                         LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST" 
23                         ;;
24                 "gui") 
25                         PORTMAP="8200:8200"
26                         ;;
27                 "cm") 
28                         PORTMAP="8150:8150"
29                         LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST" 
30                         ;;
31                 "hello") 
32                         PORTMAP="8130:8130"
33                         ;;
34                 "fs") 
35                         PORTMAP="80:8096"
36                         ;;
37         esac
38         
39         echo Starting aaf_$AAF_COMPONENT...
40
41         docker run  \
42           -d \
43           --name aaf_$AAF_COMPONENT \
44           --hostname="${AAF_COMPONENT}.aaf.osaaf.org" \
45           --add-host="$HOSTNAME:$HOST_IP" \
46           --add-host="aaf.osaaf.org:$HOST_IP" \
47           ${LINKS} \
48           --publish $PORTMAP \
49           --mount type=bind,source=$CONF_ROOT_DIR,target=/opt/app/osaaf \
50           ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
51 done