website/docker/run.sh

22 lines
530 B
Bash
Raw Normal View History

2025-01-30 15:12:50 +01:00
#!/bin/sh -e
2025-01-30 16:47:10 +01:00
# Create required directories with appropriate permissions
2025-01-30 16:51:52 +01:00
mkdir -p /app/run/caddy /app/run/gunicorn
2025-01-30 16:47:10 +01:00
2025-01-30 15:12:50 +01:00
echo "Applying database migrations"
python -m hub migrate
echo "Starting Caddy"
2025-01-30 16:51:52 +01:00
caddy start --config /etc/caddy/Caddyfile --pidfile /app/run/caddy/caddy.pid
2025-01-30 15:12:50 +01:00
echo "Starting Gunicorn"
exec \
gunicorn \
-w 4 \
--access-logfile None \
--error-log - \
--capture-output \
--pythonpath /app/.venv/lib/python3.13/site-packages/ \
2025-01-30 16:51:52 +01:00
--bind unix:/app/run/gunicorn.sock \
2025-01-30 15:12:50 +01:00
hub.wsgi:application