text2sql-demo / Dockerfile
minimew's picture
Upload Dockerfile with huggingface_hub
f940645 verified
Raw
History Blame Contribute Delete
830 Bytes
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"]