# Use official Python runtime as base image FROM python:3.11-slim # Set working directory in container WORKDIR /app # Set environment variables ENV PYTHONUNBUFFERED=1 \ PYTHONDONTWRITEBYTECODE=1 # Install dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application code COPY . . # Create non-root user for security RUN useradd -m -u 1000 botuser && \ chown -R botuser:botuser /app USER botuser # Run the bot CMD ["python", "bot.py"]