anujakkulkarni commited on
Commit
0756f8b
·
verified ·
1 Parent(s): f161d49

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use HF Spaces base image (Python 3.10)
2
+ FROM python:3.10-slim
3
+
4
+ # Avoid prompts & set a home
5
+ ENV DEBIAN_FRONTEND=noninteractive \
6
+ PYTHONDONTWRITEBYTECODE=1 \
7
+ PYTHONUNBUFFERED=1 \
8
+ PIP_NO_CACHE_DIR=1 \
9
+ PORT=7860
10
+
11
+ # System deps just in case pandas/openpyxl need them
12
+ RUN apt-get update && apt-get install -y --no-install-recommends \
13
+ build-essential \
14
+ && rm -rf /var/lib/apt/lists/*
15
+
16
+ WORKDIR /app
17
+
18
+ # Install Python deps
19
+ COPY requirements.txt /app/requirements.txt
20
+ RUN pip install --upgrade pip && pip install -r requirements.txt
21
+
22
+ # Copy app code
23
+ COPY app.py /app/app.py
24
+
25
+ # Expose the default Spaces port
26
+ EXPOSE 7860
27
+
28
+ # Start uvicorn (Spaces will route to $PORT)
29
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]