servala-portal/docker/run.sh
Tobias Brunner 6dd52cea03
All checks were successful
Build and Deploy Staging / build (push) Successful in 46s
Build and Deploy Staging / deploy (push) Successful in 7s
set uv cache dir in deployment env vars
2025-03-21 15:23:44 +01:00

25 lines
629 B
Bash

#!/bin/sh -e
# Create required directories with appropriate permissions
mkdir -p /app/run/caddy /app/run/gunicorn
# Set Caddy config location
export XDG_CONFIG_HOME="/app/config"
echo "Applying database migrations"
uv run src/manage.py migrate
echo "Starting Caddy"
exec caddy run --config /app/config/caddy/Caddyfile --adapter caddyfile 2>&1 &
echo "Starting Gunicorn"
exec \
gunicorn \
-w 4 \
--chdir /app/src \
--access-logfile - \
--error-log - \
--capture-output \
--pythonpath /app/.venv/lib/python3.13/site-packages/ \
--bind unix:/app/run/gunicorn.sock \
servala.wsgi:application