wanitilserver/docker-entrypoint.sh

38 lines
857 B
Bash

#!/bin/bash
set -e
# Apply database migrations
#echo "flush"
#python manage.py flush --no-input
echo "Apply database migrate"
python manage.py migrate --noinput
echo "Initialize system core"
python manage.py initialize_core
echo "Bootstrap system administrator"
python manage.py bootstrap_admin
if [ -n "${WANITIL_INSTALL_MODE:-}" ]; then
echo "Complete ${WANITIL_INSTALL_MODE} installation"
python manage.py complete_installation \
--mode "${WANITIL_INSTALL_MODE}" \
--lang "${WANITIL_INSTALL_LANG:-en}"
fi
echo "Collect static files"
python manage.py collectstatic --noinput
# Start server
echo "Starting gunicorn server"
exec gunicorn --bind "0.0.0.0:${APP_PORT:-80}" \
--workers 3 \
--access-logfile - \
--error-logfile - \
--timeout 120 \
main.wsgi:application
# --bind unix:/run/gunicorn.sock \