-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·29 lines (24 loc) · 976 Bytes
/
run.sh
File metadata and controls
executable file
·29 lines (24 loc) · 976 Bytes
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
#!/bin/bash
./docker/configure.sh
BUILD_FLAG=""
# Check if any argument is --rebuild
if [[ " $* " == *" --rebuild "* ]]; then
BUILD_FLAG="--build"
fi
if [[ "$1" == "--dev" ]]; then
echo "Running in development mode..."
if [ ! -f ./env/bin/activate ]; then
virtualenv env
fi
source ./env/bin/activate
pip install --index-url --index-url "${PIP_INDEX_URL:-https://pypi.org/simple}" --no-cache-dir -r requirements.txt
source ./env/bin/activate
uvicorn api.app:app --reload
else
echo "Running in production mode..."
export $(grep -v '^#' prs.env | xargs)
if [[ " $* " == *" --rebuild "* ]]; then
HTTP_PROXY="$HTTP_PROXY" HTTPS_PROXY="$HTTPS_PROXY" APT_MIRROR="$APT_MIRROR" PIP_INDEX_URL="$PIP_INDEX_URL" docker compose -p api build --no-cache api readium
fi
HTTP_PROXY="$HTTP_PROXY" HTTPS_PROXY="$HTTPS_PROXY" APT_MIRROR="$APT_MIRROR" PIP_INDEX_URL="$PIP_INDEX_URL" docker compose -p api up -d api readium
fi