mahesh1209 commited on
Commit
6f5e755
·
verified ·
1 Parent(s): c5f624f

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -0
Dockerfile ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a slim Python base image
2
+ FROM python:3.11-slim
3
+
4
+ # Ensure pip is up-to-date
5
+ RUN pip install --no-cache-dir --upgrade pip
6
+
7
+ # Create workdir
8
+ WORKDIR /app
9
+
10
+ # Copy dependency list and install
11
+ COPY requirements.txt /app/
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
+
14
+ # Copy app code
15
+ COPY api /app/api
16
+
17
+ # Spaces expect the app to listen on port 7860
18
+ EXPOSE 7860
19
+
20
+ # Start via gunicorn, binding to 0.0.0.0:7860
21
+ CMD ["gunicorn", "-w", "2", "-b", "0.0.0.0:7860", "api.app:app"]