-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocal.entrypoint.sh
More file actions
35 lines (29 loc) · 935 Bytes
/
local.entrypoint.sh
File metadata and controls
35 lines (29 loc) · 935 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
30
31
32
33
34
35
#!/bin/sh
set -e
if [ -f "./requirements.txt" ]; then
echo "Installing dependencies..."
pip install -r requirements.txt
fi
if [ -f "poetry.lock" ]; then
echo "Installing poetry dependencies..."
poetry install
fi
# Configure DATABASE_URL if POSTGRES_URL is set
if [ -n "${POSTGRES_URL}" ]; then
echo "Setting DB_ADAPTER=postgresql"
export DB_ADAPTER=postgresql
echo "Configuring SQLALCHEMY_DATABASE_URI using POSTGRES_URL"
export SQLALCHEMY_DATABASE_URI="${POSTGRES_URL}"
echo "Configuring DATABASE_URL using POSTGRES_URL"
export DATABASE_URL="${MYSQL_URL}"
fi
# Configure DATABASE_URL if MYSQL_URL is set
if [ -n "${MYSQL_URL}" ]; then
echo "Setting DB_ADAPTER=mysql"
export DB_ADAPTER=mysql
echo "Configuring SQLALCHEMY_DATABASE_URI using MYSQL_URL"
export SQLALCHEMY_DATABASE_URI="${MYSQL_URL}"
echo "Configuring DATABASE_URL using MYSQL_URL"
export DATABASE_URL="${MYSQL_URL}"
fi
exec "$@"