FROM python:3.11-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements
COPY pyproject.toml ./
COPY poetry.lock* ./

# Install Python dependencies
RUN pip install uv && \
    uv sync --no-dev

# Copy application
COPY . .

# Create non-root user
RUN useradd --create-home --shell /bin/bash {}
RUN chown -R {}:{} /app
USER {}

EXPOSE 8080

CMD ["python", "bot.py"]