summaryrefslogtreecommitdiffstats
path: root/deployment/docker-entrypoint.sh
blob: bc442b4c72a4a4e3151df811a89a9c483db2af31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

function start_consul_server {
    consul agent -bootstrap -server -bind=127.0.0.1 -data-dir=/dkv_mount_path/consul_data &
}

function start_api_server {
    pushd /dkv_mount_path/
    ./dkv
}

if [ "$DATASTORE_IP" = "localhost" ]; then
    if  [ "$DATASTORE" = "consul" ]; then
        start_consul_server
        sleep 5
    fi
fi
start_api_server