-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
44 lines (36 loc) · 982 Bytes
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
USR_ENV=$1
COMPOSE=false
export IMG_USER=$(whoami)
export IMG_UID=$(id -u)
export IMG_GID=$(id -g)
if [ -z $USR_ENV ]
then
echo ">> Please specify either production or development as an environment"
else
if [ $USR_ENV = "production" ]
then
export PORT=84
export DOCKERFILE=Dockerfile
COMPOSE=true
elif [ $USR_ENV = "development" ]
then
export PORT=5000
export DOCKERFILE=Dockerfile.dev
COMPOSE=true
fi
# if [ -f Identity/.env ]
# then
echo "Preparing docker-compose file..."
if [ $COMPOSE = true ]
then
# docker-compose -f docker/docker-compose.yml config
docker-compose -p identity -f ./Docker/docker-compose.yml up --build --remove-orphans -d
else
echo ">> Provided environment not supported"
fi
# else
# echo ">> You need to create an .env file (even if it's empty"
# fi
fi
# echo $MY_ENV