diff --git a/0-wait-dependencies.sh b/0-wait-dependencies.sh new file mode 100755 index 00000000..9f52b19d --- /dev/null +++ b/0-wait-dependencies.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env sh + +set -e + +if [ -n "$SERVICE_DEPENDENCIES" ]; then + + for dep in $SERVICE_DEPENDENCIES; do + + host="$(echo $dep | cut -d':' -f1)" + port="$(echo $dep | cut -d':' -f2)" + + wait-for-service.sh -h $host -p $port + done +fi diff --git a/README.md b/README.md index 7fd72cec..794a738f 100644 --- a/README.md +++ b/README.md @@ -27,18 +27,42 @@ To build all artefacts and docker images run: ./build.sh ``` -# Deploying +# Deployment -Deployment is achieve using a docker compose file. For it to work a docker swarm needs to be initialized and all required nodes to be joined in the swarm. +Deployment is achieved using a docker compose file. For it to work a docker swarm needs to be initialized and all required nodes to be joined in the swarm. Note that images need to be in a docker registry (so that docker can pull them) or to be present on all machines. -There is also a proxy service (nginx) that is used for ssl termination and to proxy most services through a single address. It requires the `NGINX_SERVER_NAME` to be set to the public hostname of the machine running it. You can either `export` it beforehand or pass it in when deploying. - For ssl to work the certificate and public key must be placed inside `/etc/sep/keystores` and be named nginx.crt and nginx.key. Also for graphdb to work you need to place your license file in `/etc/sep/licenses/graphdb.license`. +## Service placement +The compose file uses docker's placement constraints. These are labels added to a service to constrain where it could be deployed. +Before deploying you need to set the appropriate node labels to the nodes in your swarm. + +To do that - on the master node execute `docker node update --label-add