Alshargi commited on
Commit
a0e7868
·
verified ·
1 Parent(s): d459df2

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -0
Dockerfile ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ ENV PYTHONDONTWRITEBYTECODE=1
4
+ ENV PYTHONUNBUFFERED=1
5
+ ENV PIP_NO_CACHE_DIR=1
6
+
7
+ WORKDIR /app
8
+
9
+ # System deps (FAISS / torch runtime deps)
10
+ RUN apt-get update && apt-get install -y --no-install-recommends \
11
+ git \
12
+ libgomp1 \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ # Install Python deps
16
+ COPY requirements.txt .
17
+ RUN pip install --upgrade pip && pip install -r requirements.txt
18
+
19
+ # Copy app code + assets (faiss.index + metadata)
20
+ COPY . .
21
+
22
+ # Hugging Face Spaces uses PORT env var sometimes; default to 7860
23
+ ENV PORT=7860
24
+ EXPOSE 7860
25
+
26
+ # Start FastAPI
27
+ CMD ["bash", "-lc", "uvicorn app:app --host 0.0.0.0 --port ${PORT}"]