-
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.
Merge pull request #2 from hotosm/feat/set_up
build: entrypoint in all stages, remove wait-for-it
- Loading branch information
Showing
3 changed files
with
21 additions
and
206 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
#!/bin/sh | ||
|
||
# WARNING: | ||
# Migrating database at the same time as starting the server IS NOT THE BEST | ||
# PRACTICE. The database should be migrated manually or using the release | ||
# phase facilities of your hosting platform. This is used only so the | ||
# Wagtail instance can be started with a simple "docker run" command. | ||
|
||
# Apply database migrations | ||
echo "Apply database migrations" | ||
python manage.py migrate | ||
|
||
# Collect static | ||
echo "Collect static files" | ||
python manage.py collectstatic --noinput --clear | ||
|
||
# Create superuser | ||
echo "Creating superuser" | ||
if [ -z "$DJANGO_SUPERUSER_USERNAME" ] || [ -z "$DJANGO_SUPERUSER_PASSWORD" ] ; then | ||
echo "Superuser credentials not provided, skipping superuser creation." | ||
else | ||
echo "Creating superuser $DJANGO_SUPERUSER_USERNAME" | ||
echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('$DJANGO_SUPERUSER_USERNAME', '$DJANGO_SUPERUSER_EMAIL', '$DJANGO_SUPERUSER_PASSWORD')" | python manage.py shell | ||
fi | ||
|
||
# Start server | ||
echo "Starting server" | ||
gunicorn hot_osm.wsgi:application | ||
echo "Running command: $@" | ||
exec "$@" |
This file was deleted.
Oops, something went wrong.