- Add docker-compose.yml with PostgreSQL 16 container (port 5433) - Create async database session factory with connection pooling - Configure SQLAlchemy 2.0 DeclarativeBase for models - Update .env.example with correct database URL Connection pool settings from research: pool_size=10, max_overflow=20, pool_recycle=1800 (30 min), pool_pre_ping=True for validation.
23 lines
620 B
Text
23 lines
620 B
Text
# Database Configuration
|
|
# PostgreSQL connection string using asyncpg driver
|
|
DATABASE_URL=postgresql+asyncpg://debate:debate_dev@localhost:5433/debate
|
|
|
|
# Security
|
|
# Generate with: openssl rand -hex 32
|
|
SECRET_KEY=your-secret-key-here-generate-with-openssl-rand-hex-32
|
|
|
|
# Environment
|
|
# Options: development, production
|
|
ENVIRONMENT=development
|
|
|
|
# Debug Mode
|
|
# Set to false in production
|
|
DEBUG=true
|
|
|
|
# Allowed Hosts
|
|
# Comma-separated list of allowed host headers
|
|
ALLOWED_HOSTS=localhost,127.0.0.1
|
|
|
|
# CORS Origins
|
|
# Comma-separated list of allowed origins for CORS
|
|
ALLOWED_ORIGINS=http://localhost:3000,http://127.0.0.1:3000
|