Percy3822 commited on
Commit
6232d77
·
verified ·
1 Parent(s): ddd62aa

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 2) Dockerfile (paste as a new file)
2
+
3
+ ```dockerfile
4
+ FROM python:3.10-slim
5
+
6
+ # Avoid interactive tzdata etc.
7
+ ENV DEBIAN_FRONTEND=noninteractive \
8
+ PYTHONDONTWRITEBYTECODE=1 \
9
+ PYTHONUNBUFFERED=1
10
+
11
+ # System deps (optional but useful for some libs)
12
+ RUN apt-get update && apt-get install -y --no-install-recommends \
13
+ build-essential curl && \
14
+ rm -rf /var/lib/apt/lists/*
15
+
16
+ WORKDIR /code
17
+
18
+ # Install Python deps first (cached layer)
19
+ COPY requirements.txt .
20
+ RUN pip install --no-cache-dir -r requirements.txt
21
+
22
+ # Copy app files
23
+ COPY . .
24
+
25
+ # Expose HF Spaces default port
26
+ EXPOSE 7860
27
+
28
+ # Start FastAPI with uvicorn
29
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]