initialize docker build

This commit is contained in:
Tobias Brunner 2025-03-07 09:16:24 +01:00
parent 2e49849960
commit c2c5b62a63
No known key found for this signature in database
4 changed files with 121 additions and 0 deletions

24
docker/run.sh Normal file
View file

@ -0,0 +1,24 @@
#!/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 \
--access-logfile - \
--error-log - \
--capture-output \
--pythonpath /app/.venv/lib/python3.13/site-packages/ \
--bind unix:/app/run/gunicorn.sock \
servala.wsgi:application