-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from tiangolo/add-prestart-sh
Add support for /app/prestart.sh
- Loading branch information
Showing
37 changed files
with
582 additions
and
130 deletions.
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#! /usr/bin/env sh | ||
|
||
echo "Running inside /app/prestart.sh, you could add migrations to this file, e.g.:" | ||
|
||
echo " | ||
#! /usr/bin/env bash | ||
# Let the DB start | ||
sleep 10; | ||
# Run migrations | ||
alembic upgrade head | ||
" |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#! /usr/bin/env sh | ||
set -e | ||
|
||
# If there's a prestart.sh script in the /app directory, run it before starting | ||
PRE_START_PATH=/app/prestart.sh | ||
echo "Checking for script in $PRE_START_PATH" | ||
if [ -f $PRE_START_PATH ] ; then | ||
echo "Running script $PRE_START_PATH" | ||
. "$PRE_START_PATH" | ||
else | ||
echo "There is no script $PRE_START_PATH" | ||
fi | ||
|
||
# Start Gunicorn | ||
exec gunicorn -k egg:meinheld#gunicorn_worker -c "$GUNICORN_CONF" "$APP_MODULE" |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#! /usr/bin/env sh | ||
|
||
echo "Running inside /app/prestart.sh, you could add migrations to this file, e.g.:" | ||
|
||
echo " | ||
#! /usr/bin/env bash | ||
# Let the DB start | ||
sleep 10; | ||
# Run migrations | ||
alembic upgrade head | ||
" |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#! /usr/bin/env sh | ||
set -e | ||
|
||
# If there's a prestart.sh script in the /app directory, run it before starting | ||
PRE_START_PATH=/app/prestart.sh | ||
echo "Checking for script in $PRE_START_PATH" | ||
if [ -f $PRE_START_PATH ] ; then | ||
echo "Running script $PRE_START_PATH" | ||
. "$PRE_START_PATH" | ||
else | ||
echo "There is no script $PRE_START_PATH" | ||
fi | ||
|
||
# Start Gunicorn | ||
exec gunicorn -k egg:meinheld#gunicorn_worker -c "$GUNICORN_CONF" "$APP_MODULE" |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#! /usr/bin/env sh | ||
|
||
echo "Running inside /app/prestart.sh, you could add migrations to this file, e.g.:" | ||
|
||
echo " | ||
#! /usr/bin/env bash | ||
# Let the DB start | ||
sleep 10; | ||
# Run migrations | ||
alembic upgrade head | ||
" |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#! /usr/bin/env sh | ||
set -e | ||
|
||
# If there's a prestart.sh script in the /app directory, run it before starting | ||
PRE_START_PATH=/app/prestart.sh | ||
echo "Checking for script in $PRE_START_PATH" | ||
if [ -f $PRE_START_PATH ] ; then | ||
echo "Running script $PRE_START_PATH" | ||
. "$PRE_START_PATH" | ||
else | ||
echo "There is no script $PRE_START_PATH" | ||
fi | ||
|
||
# Start Gunicorn | ||
exec gunicorn -k egg:meinheld#gunicorn_worker -c "$GUNICORN_CONF" "$APP_MODULE" |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#! /usr/bin/env sh | ||
|
||
echo "Running inside /app/prestart.sh, you could add migrations to this file, e.g.:" | ||
|
||
echo " | ||
#! /usr/bin/env bash | ||
# Let the DB start | ||
sleep 10; | ||
# Run migrations | ||
alembic upgrade head | ||
" |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#! /usr/bin/env sh | ||
set -e | ||
|
||
# If there's a prestart.sh script in the /app directory, run it before starting | ||
PRE_START_PATH=/app/prestart.sh | ||
echo "Checking for script in $PRE_START_PATH" | ||
if [ -f $PRE_START_PATH ] ; then | ||
echo "Running script $PRE_START_PATH" | ||
. "$PRE_START_PATH" | ||
else | ||
echo "There is no script $PRE_START_PATH" | ||
fi | ||
|
||
# Start Gunicorn | ||
exec gunicorn -k egg:meinheld#gunicorn_worker -c "$GUNICORN_CONF" "$APP_MODULE" |
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
Oops, something went wrong.