shubham5524 commited on
Commit
c6d5a36
·
verified ·
1 Parent(s): bcf4ce7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +31 -10
Dockerfile CHANGED
@@ -1,10 +1,31 @@
1
- FROM python:3.10-slim
2
-
3
- WORKDIR /app
4
-
5
- COPY requirements.txt .
6
- RUN pip install --no-cache-dir -r requirements.txt
7
-
8
- COPY . .
9
-
10
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.10-slim
3
+
4
+ # Set environment variables
5
+ ENV PYTHONDONTWRITEBYTECODE=1
6
+ ENV PYTHONUNBUFFERED=1
7
+
8
+ # Install system dependencies for OpenCV
9
+ RUN apt-get update && apt-get install -y \
10
+ libgl1-mesa-glx \
11
+ libglib2.0-0 \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ # Set the working directory in the container
15
+ WORKDIR /app
16
+
17
+ # Copy requirements
18
+ COPY requirements.txt .
19
+
20
+ # Install Python dependencies
21
+ RUN pip install --upgrade pip
22
+ RUN pip install -r requirements.txt
23
+
24
+ # Copy the app code
25
+ COPY . .
26
+
27
+ # Expose the port (change if your app uses a different port)
28
+ EXPOSE 8000
29
+
30
+ # Run the app using Uvicorn
31
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]