minimew commited on
Commit
c410269
·
verified ·
1 Parent(s): 38552be

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -0
Dockerfile ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ WORKDIR /app
4
+
5
+ RUN apt-get update && apt-get install -y --no-install-recommends \
6
+ gcc g++ \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ # Install CPU-only PyTorch first (saves ~4 GB vs default CUDA build)
10
+ RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
11
+
12
+ COPY requirements.txt .
13
+ RUN pip install --no-cache-dir -r requirements.txt
14
+
15
+ # App source
16
+ COPY src/ src/
17
+
18
+ # Spider fixed database (for the concert_singer demo mode)
19
+ COPY spider_data/tables.json spider_data/tables.json
20
+ COPY spider_data/database/concert_singer/ spider_data/database/concert_singer/
21
+
22
+ # HF Spaces requires port 7860
23
+ EXPOSE 7860
24
+
25
+ CMD ["python", "-m", "uvicorn", "src.app.api:app", "--host", "0.0.0.0", "--port", "7860"]