- 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.
19 lines
427 B
Docker
19 lines
427 B
Docker
# 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"]
|