website/docker/run.sh

23 lines
554 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
mkdir -p /run/caddy /run/gunicorn
chmod 777 /run /run/caddy /run/gunicorn
2025-01-30 15:12:50 +01:00
echo "Applying database migrations"
python -m hub migrate
echo "Starting Caddy"
2025-01-30 16:47:10 +01:00
caddy start --config /etc/caddy/Caddyfile --pidfile /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/ \
--bind unix:/run/gunicorn.sock \
hub.wsgi:application