Enhance Telegram bot with database integration and API features
- Added SQLite database support with Alembic for migrations. - Implemented FastAPI for HTTP API to manage duties. - Updated configuration to include database URL and HTTP port. - Created entrypoint script for Docker to handle migrations and permissions. - Expanded command handlers to register users and display duties. - Developed a web application for calendar display of duties. - Included necessary Pydantic schemas and SQLAlchemy models for data handling. - Updated requirements.txt to include new dependencies for FastAPI and SQLAlchemy.
This commit is contained in:
11
entrypoint.sh
Normal file
11
entrypoint.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
# Ensure data dir exists and is writable by botuser (volume may be root-owned)
|
||||
mkdir -p /app/data
|
||||
chown botuser:botuser /app/data
|
||||
# Apply Alembic migrations (runs as root, creates DB in /app/data)
|
||||
alembic upgrade head
|
||||
# Ensure new DB file is owned by botuser so the app can write
|
||||
chown -R botuser:botuser /app/data
|
||||
# Run the app as botuser
|
||||
exec gosu botuser "$@"
|
||||
Reference in New Issue
Block a user