0de2eb5830
- Added authentication routes for login, registration, password reset, and account deletion in `auth.py`. - Implemented user profile management, including updating user information and changing passwords. - Created dashboard views to display user-specific information and recent activity in `dashboard.py`. - Developed leaderboard views to show team rankings and points in `leaderboard.py`. - Added QR code generation and redemption functionality in `qr.py` and `redeem.py`. - Implemented team management features, allowing users to create and join teams in `teams.py`. - Introduced session debugging utility to assist with session-related issues in `debug_session.py`. - Configured Docker Compose for MySQL database and FastAPI application with environment variables. - Updated requirements.txt to include necessary dependencies for the application.
48 lines
1.1 KiB
YAML
48 lines
1.1 KiB
YAML
version: "3.9"
|
|
|
|
services:
|
|
db:
|
|
image: mysql:8.0
|
|
container_name: pubquiz_mysql
|
|
restart: always
|
|
environment:
|
|
MYSQL_DATABASE: "pubquiz_db"
|
|
MYSQL_USER: "pubquiz_user"
|
|
MYSQL_PASSWORD: "pubquiz_pass"
|
|
MYSQL_ROOT_PASSWORD: "root_pass"
|
|
ports:
|
|
- "3306:3306"
|
|
volumes:
|
|
- db_data:/var/lib/mysql
|
|
healthcheck:
|
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p$$MYSQL_ROOT_PASSWORD"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 20
|
|
|
|
app:
|
|
build: .
|
|
container_name: pubquiz_app
|
|
restart: unless-stopped
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
DB_HOST: "db"
|
|
DB_PORT: "3306"
|
|
DB_NAME: "pubquiz_db"
|
|
DB_USER: "pubquiz_user"
|
|
DB_PASS: "pubquiz_pass"
|
|
# Session configuration
|
|
SECRET_KEY: "a-stronger-secret-key-for-sessions-32chars"
|
|
DEBUG: "True"
|
|
SESSION_MAX_AGE: "86400" # 24 hours
|
|
COOKIE_SECURE: "False" # Set to True in production with HTTPS
|
|
ports:
|
|
- "8000:8000"
|
|
volumes:
|
|
- ./:/app:delegated
|
|
|
|
volumes:
|
|
db_data:
|