-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-bash
More file actions
executable file
·14 lines (14 loc) · 885 Bytes
/
start-bash
File metadata and controls
executable file
·14 lines (14 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
export COMPOSE_PROJECT_NAME=$(id -un)
[ ! -f docker-compose.yml ] && export COMPOSE_FILE=/usr/lib/dk-compose/docker-compose.yml
XSHARED=${XSHARED:-$HOME}
XADDITIONS=${XADDITIONS:-$HOME/.docker-mern-dev/additions}
XLOCAL=${XLOCAL:-$HOME/.docker-mern-dev/local}
XDBDATA=${XDBDATA:-$HOME/.docker-mern-dev/db-data}
[ -z "$WEB_PORT" ] && let "WEB_PORT = $(id -u) + 8000" && export WEB_PORT
[ -z "$WEB_DEV_PORT" ] && let "WEB_DEV_PORT = $(id -u) + 3000" && export WEB_DEV_PORT
[ -z "$VS_CODE_PORT" ] && let "VS_CODE_PORT = $(id -u) + 8443" && export VS_CODE_PORT
[ -z "$VCAP_APP_PORT" ] && let "VCAP_APP_PORT = $(id -u) + 8081" && export VCAP_APP_PORT
export XUID=$(id -u) XGID=$(id -g) XSHARED XADDITIONS XLOCAL XDBDATA VCAP_APP_PORT
docker-compose exec node echo "Container is running... starting bash" 2>/dev/null || docker-compose up --build -d
docker-compose exec node bash