run.sh 544 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
PORT=$(grep -Po 'port: \K.*?(?=,)' config_dist.js)
NAME=$(grep -Po " id: '\K.*?(?=')" config_dist.js)
echo "Running service $NAME on port $PORT"

docker run --name kl_redis -d redis || true

mkdir -p /srv/kl/$NAME/config
mkdir -p /srv/kl/$NAME/logs
mkdir -p /srv/kl/$NAME/files
mkdir -p /srv/kl/$NAME/tmp

docker run --name $NAME -it -d --link kl_redis:redis \
  -p $PORT:$PORT \
  -v /srv/kl/$NAME/config:/config \
  -v /srv/kl/$NAME/logs:/wrapper/logs \
  -v /srv/kl/$NAME/files:/wrapper/files \
  -v /srv/kl/$NAME/tmp:/wrapper/tmp \
  $NAME