File size: 830 Bytes
f940645
c410269
 
 
f940645
 
 
 
 
 
 
 
 
 
 
 
c410269
 
 
 
3cae36b
c410269
3cae36b
c410269
 
 
 
 
f940645
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
FROM python:3.11-slim

WORKDIR /app

ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8

RUN apt-get update && apt-get install -y --no-install-recommends \
    gcc g++ \
    && rm -rf /var/lib/apt/lists/*

# CPU-only torch (~190 MB) -- cached after first successful build
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# App source
COPY src/ src/

# Spider schema index + demo databases
COPY spider_data/tables.json spider_data/tables.json
COPY spider_data/database/retail_store/ spider_data/database/retail_store/
COPY spider_data/database/concert_singer/ spider_data/database/concert_singer/

# HF Spaces requires port 7860
EXPOSE 7860

CMD ["python", "-m", "uvicorn", "src.app.api:app", "--host", "0.0.0.0", "--port", "7860"]