timetracker/entrypoint.sh

14 lines
454 B
Bash
Raw Normal View History

2023-01-03 13:29:39 +00:00
#!/bin/bash
2023-01-03 12:04:05 +00:00
# Apply database migrations
2023-01-07 20:09:47 +00:00
set -euo pipefail
2023-01-03 12:04:05 +00:00
echo "Apply database migrations"
2023-01-19 18:46:43 +00:00
poetry run python src/timetracker/manage.py migrate
2023-01-03 12:04:05 +00:00
2023-01-07 17:10:36 +00:00
echo "Collect static files"
2023-01-19 18:46:43 +00:00
poetry run python src/timetracker/manage.py collectstatic --clear --no-input
2023-01-07 17:10:36 +00:00
2023-01-03 12:04:05 +00:00
echo "Starting server"
2023-01-07 20:59:17 +00:00
caddy start
2023-01-19 18:46:43 +00:00
cd src/timetracker || exit
2023-01-19 19:20:50 +00:00
poetry run python -m gunicorn --bind 0.0.0.0:8001 root.asgi:application -k uvicorn.workers.UvicornWorker --access-logfile - --error-logfile -