Spaces:
Running
Running
| # Use official Python 3.11 slim image | |
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| git \ | |
| curl \ | |
| wget \ | |
| supervisor \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # ββ Remove ALL default supervisor configs shipped by apt βββββββββββββββββββββ | |
| RUN rm -f /etc/supervisor/supervisord.conf \ | |
| /etc/supervisor/conf.d/*.conf | |
| # Copy requirements first (for layer caching) | |
| COPY requirements.txt . | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # Copy application code | |
| COPY . . | |
| # ββ Place our supervisor config at the root level so it is fully standalone ββ | |
| COPY supervisord.conf /etc/supervisord.conf | |
| RUN chmod 644 /etc/supervisord.conf | |
| # ββ Copy and permission the entrypoint cleanup script ββββββββββββββββββββββββ | |
| COPY entrypoint.sh /entrypoint.sh | |
| RUN chmod +x /entrypoint.sh | |
| # ββ Create runtime directories with correct permissions ββββββββββββββββββββββ | |
| RUN mkdir -p /app/logs /app/ranker_logs && \ | |
| chmod 777 /app/logs /app/ranker_logs | |
| # Expose hub (7860 = HuggingFace public) + dashboard (8051 = internal) | |
| EXPOSE 7860 8051 | |
| USER root | |
| # Entrypoint cleans up stale state, then execs supervisord | |
| CMD ["/entrypoint.sh"] |