Files
sneakyklaus/entrypoint.sh
Phil Skentelbery b38fc328f9 fix: resolve database and session initialization issues
- Switch from SQLAlchemy sessions to filesystem sessions to avoid race
  conditions with multiple gunicorn workers trying to create the sessions
  table simultaneously
- Update Alembic env.py to use a minimal Flask app without Flask-Session
  to prevent session table creation during migrations
- Add data directory creation to entrypoint.sh for clean container starts
- Configure test environment to use filesystem sessions with temp directory

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 18:57:57 -07:00

18 lines
443 B
Bash
Executable File

#!/bin/bash
set -e # Exit on any error
# Ensure data directory exists
mkdir -p /app/data
echo "Running database migrations..."
if uv run alembic upgrade head; then
echo "Database migrations completed successfully"
else
echo "ERROR: Database migration failed!"
echo "Please check the logs above for details."
exit 1
fi
echo "Starting application server..."
exec gunicorn --bind 0.0.0.0:8000 --workers 2 --threads 4 main:app