Roo-Code/reranker-service/Dockerfile
Abinand Nallathambi 6fe86f074f feat: Add code search reranking support via external services
- Implement pluggable reranker architecture with HTTP API communication
- Add LocalReranker implementation for self-hosted reranking services
- Include reference Python reranker service with Docker support
- Add comprehensive UI configuration options in settings
- Implement proper error handling and fallback mechanisms
- Add extensive test coverage for all reranking functionality
- Support internationalization for all 18 languages
- Update documentation with feature overview and usage instructions

The extension now supports optional reranking of code search results
through external services, improving search relevance while maintaining
user privacy and control.
2025-08-02 15:43:50 -04:00

48 lines
No EOL
1.2 KiB
Docker

FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Create cache directory for models
RUN mkdir -p /app/.cache/models
# Download the model during build to cache it
RUN python -c "from sentence_transformers import CrossEncoder; CrossEncoder('cross-encoder/ms-marco-MiniLM-L-6-v2', cache_folder='/app/.cache/models')"
# Create a non-root user to run the application
RUN useradd -m -u 1000 appuser && \
chown -R appuser:appuser /app
# Switch to non-root user
USER appuser
# Expose port
EXPOSE 8080
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV MODEL_CACHE_DIR=/app/.cache/models
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl -f http://localhost:8080/health || exit 1
# Run the application
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080", "--workers", "1"]