FROM python:3.11-slim WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ gcc \ libpq-dev \ && rm -rf /var/lib/apt/lists/* # Copy dependency files COPY pyproject.toml ./ # Install Python dependencies RUN pip install --no-cache-dir -e . # Copy application code COPY src/ ./src/ COPY migrations/ ./migrations/ COPY alembic.ini ./ # Create non-root user RUN useradd -m -u 1000 guardden && chown -R guardden:guardden /app USER guardden # Run the bot CMD ["python", "-m", "guardden"]