This repository has been archived by the owner on Feb 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: enable wait for it via env var (#31)
* chore: add wait-for-it to dockerfile * feat: add and document wait-for-it behaviour * chore: fix use of wait-for-it * chore: raise timeout to 120 seconds * chore: add prints to entrypoint
- Loading branch information
Showing
3 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
#! /usr/bin/env sh | ||
set -e | ||
|
||
if [[ -z "${WAIT_FOR_IT_ADDRESS}" ]]; then | ||
echo "Skipping wait-for-it ($$WAIT_FOR_IT_ADDRESS is not defined)" | ||
else | ||
echo "running wait-for-it.sh -t 120 ${WAIT_FOR_IT_ADDRESS}" | ||
/wait-for-it.sh -t 120 "${WAIT_FOR_IT_ADDRESS}" | ||
fi | ||
|
||
echo "Ensuring database existence" | ||
python ./scripts/ensure-database.py | ||
|
||
echo "Upgrading database" | ||
alembic upgrade head | ||
|
||
echo "Launching uvicorn server" | ||
exec uvicorn app.main:app --host 0.0.0.0 --port ${PORT} |