Add initial project structure for Telegram bot
- Created Docker configuration files for development and production. - Added Dockerfile for building the bot image. - Implemented configuration loading from environment variables. - Developed main application logic and command handlers. - Included README with setup instructions and usage details. - Added .gitignore and .dockerignore files to exclude unnecessary files. - Provided example environment file (.env.example) for bot token configuration. - Established basic error handling for the bot.
This commit is contained in:
18
Dockerfile
Normal file
18
Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
# Single image for both dev and prod; Compose files differentiate behavior.
|
||||
FROM python:3.12-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Application code
|
||||
COPY config.py main.py ./
|
||||
COPY handlers/ ./handlers/
|
||||
|
||||
# Run as non-root
|
||||
RUN adduser --disabled-password --gecos "" botuser && chown -R botuser:botuser /app
|
||||
USER botuser
|
||||
|
||||
CMD ["python", "main.py"]
|
||||
Reference in New Issue
Block a user