File size: 907 Bytes
fab9847
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.10-slim

WORKDIR /app

# Install Node.js 18 via NodeSource (Vite requires Node >= 18)
RUN apt-get update && \
    apt-get install -y curl && \
    curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
    apt-get install -y nodejs && \
    rm -rf /var/lib/apt/lists/*

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

# Copy project files
COPY config.py api_server.py ./
COPY agent/ ./agent/
COPY core/ ./core/
COPY output/ ./output/
COPY data/llm_event_scores.json ./data/llm_event_scores.json
COPY data/consumer_confidence_cache.csv ./data/consumer_confidence_cache.csv

# Build frontend
COPY frontend/ ./frontend/
RUN cd frontend && npm install && npm run build

# Expose port 7860 (HuggingFace Spaces default)
EXPOSE 7860

ENV PYTHONUTF8=1

CMD ["uvicorn", "api_server:app", "--host", "0.0.0.0", "--port", "7860"]