website/docker/run.sh

25 lines
595 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 17:15:36 +01:00
# Set Caddy config location
export XDG_CONFIG_HOME="/app/config"
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 17:15:36 +01:00
exec caddy run --config /app/config/caddy/Caddyfile --adapter caddyfile 2>&1 &
2025-01-30 15:12:50 +01:00
echo "Starting Gunicorn"
exec \
gunicorn \
-w 4 \
2025-01-30 17:15:36 +01:00
--access-logfile - \
2025-01-30 15:12:50 +01:00
--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