-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.bash
39 lines (29 loc) · 813 Bytes
/
setup.bash
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
#!/bin/bash
PROJECT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
export DB_CONN="sqlite:///db.db"
function install_uvicorn() {
cd "${PROJECT_DIR}/backend"
python3 -m venv venv
source "venv/bin/activate"
pip install wheel
pip install "fastapi[All]"
pip install -r "${PROJECT_DIR}/backend/requirements.txt"
pip install "uvicorn[standard]"
deactivate
}
function run_fastapi() {
source "${PROJECT_DIR}/backend/venv/bin/activate"
cd "${PROJECT_DIR}/backend"
uvicorn main:app --reload
}
function run_postgres() {
docker run \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_USER=postgres \
-e POSTGRES_DB=postgres \
-p 5432:5432 \
-d postgres
}
function install_postgres() {
docker pull postgres
}