-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·52 lines (50 loc) · 1.96 KB
/
start.sh
File metadata and controls
executable file
·52 lines (50 loc) · 1.96 KB
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
45
46
47
48
49
50
51
52
#! /bin/bash
# if the argument provided is --local, then start the docker-compose-only-db.yml file, if the argument provided is --development, then start the docker compose with the docker-compose.yml file, if the argument provided is --production, then start the docker compose with the docker-compose-production.yml
if [ "$1" == "--local" ]; then
echo "--> Starting local development environment"
docker-compose -f docker-compose-only-db.yml up -d
sleep 3
## start backend
echo "--> Starting backend flask server"
cd backend
.venv/bin/python app.py &
sleep 3
## start frontend
echo "--> Starting frontend react server"
cd ../frontend
# yarn start:dev-open
yarn start:next:dev:port
# done
echo "--> Done"
exit 0
elif [ "$1" == "--development" ]; then
## if the second argument is --build then echo hello, else say hi
if [ "$2" == "--build" ]; then
echo "--> Starting development environment with build"
docker-compose up --build
else
echo "--> Starting development environment without build"
docker-compose up
fi
echo "--> Done"
elif [ "$1" == "--only-frontend" ]; then
## if the second argument is --build then echo hello, else say hi
if [ "$2" == "--development" ]; then
echo "--> Starting development environment with build"
docker-compose -f docker-compose-only-frontend.yml up --build
elif [ "$2" == "--production" ]; then
echo "--> Starting production environment with build"
docker-compose -f docker-compose-production-only-frontend.yml up --build -d
else
echo "--> Can only be used with --development or --production"
fi
echo "--> Done"
exit 0
elif [ "$1" == "--production" ]; then
echo "--> Starting production environment"
docker-compose -f docker-compose-production.yml up --build -d
echo "--> Done"
exit 0
else
echo "Please provide an argument: --local, --development or --production"
fi