Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docker/backend/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
#SPDX-License-Identifier: MIT
set -e

if [[ -z "$AUGUR_DB" ]]; then
# Require AUGUR_DB_HOST, AUGUR_DB_USER, AUGUR_DB_PASSWORD, and AUGUR_DB_NAME to be set
if [[ -z "$AUGUR_DB_HOST" ]] || [[ -z "$AUGUR_DB_USER" ]] || [[ -z "$AUGUR_DB_PASSWORD" ]] || [[ -z "$AUGUR_DB_NAME" ]]; then
echo -e "When AUGUR_DB is not set, you must set AUGUR_DB_HOST, AUGUR_DB_USER,\nAUGUR_DB_PASSWORD, and AUGUR_DB_NAME"
exit 1
fi
# Construct AUGUR_DB from the individual components
export AUGUR_DB="postgresql+psycopg2://${AUGUR_DB_USER}:${AUGUR_DB_PASSWORD}@${AUGUR_DB_HOST}/${AUGUR_DB_NAME}"
fi

if [[ "$AUGUR_DB" == *"localhost"* ]]; then
echo "localhost db connection"
export AUGUR_DB="${AUGUR_DB/localhost/host.docker.internal}"
Expand Down
Loading