Spaces:
Running
Running
File size: 1,505 Bytes
8efd599 e5b81b3 8efd599 e5b81b3 8efd599 e5b81b3 8efd599 e5b81b3 8efd599 e5b81b3 8efd599 e5b81b3 8efd599 e5b81b3 8efd599 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | # 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"] |