FROM python:3.11-slim WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ gcc \ && rm -rf /var/lib/apt/lists/* # Copy requirements first to leverage Docker cache COPY requirements.txt . # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Copy application code COPY . . # Create non-root user RUN adduser --disabled-password --gecos '' appuser RUN chown -R appuser:appuser /app USER appuser # Expose port EXPOSE 8080 # Run the bot CMD ["python", "bot.py"]