File size: 1,210 Bytes
8602315
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Dockerfile (Final Definitive Version)

# Start with a standard Python 3.10 image
FROM python:3.10-slim

WORKDIR /app

# Ensure HOME is set so git --global writes to /root/.gitconfig (HF build step)
ENV HOME=/root

RUN apt-get update && \

    apt-get install -y --no-install-recommends \
    supervisor \
    wget \
    build-essential \
    git \
    && apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Upgrade pip and install wheel to speed up package installations
RUN pip install --no-cache-dir --upgrade pip wheel setuptools

# Copy and install all Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of your application code
COPY . .

# Ensure Chroma data directory exists and is writable
RUN mkdir -p /data/chroma_db_store && chmod -R 777 /data

# Copy your supervisor configuration
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

# Set default port (HF injects PORT env)
ENV PORT=7860

# Hugging Face Spaces expose port 7860 by default
EXPOSE 7860

# The final command to run when the container starts
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]