File size: 972 Bytes
ee39cc9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Hugging Face Spaces - Docker for Ingestion Pipeline
FROM python:3.11-slim

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

# System deps (same as main system)
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential curl git libglib2.0-0 libgl1 \
    && rm -rf /var/lib/apt/lists/*

# Create and use a non-root user (same as main system)
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"

# Set working directory
WORKDIR /app

# Copy ingestion pipeline files (includes utils and helpers)
COPY . .

# Install Python dependencies (same as main system)
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt

# No local model caches or warmup needed (remote embedding service)

# Expose port for HF Spaces
ENV PORT=7860
EXPOSE 7860

# Start FastAPI (single worker so app.state.jobs remains consistent)
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]