saad003 commited on
Commit
398e9a3
·
verified ·
1 Parent(s): bdbadcd

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -0
Dockerfile ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Dockerfile
2
+ FROM python:3.10
3
+
4
+ # Create non-root user (as HF recommends)
5
+ RUN useradd -m -u 1000 user
6
+ USER user
7
+ ENV PATH="/home/user/.local/bin:$PATH"
8
+ WORKDIR /app
9
+
10
+ # Copy and install requirements
11
+ COPY --chown=user requirements.txt /app/requirements.txt
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
+
14
+ # Copy app code
15
+ COPY --chown=user . /app
16
+
17
+ # Run FastAPI app on port 7860 (required by Spaces)
18
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]