guruthetechie commited on
Commit
2b85ffb
·
verified ·
1 Parent(s): 2803042

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use official slim Python image
2
+ FROM python:3.11-slim
3
+
4
+ # Avoid buffering, useful for logs
5
+ ENV PYTHONUNBUFFERED=1
6
+
7
+ WORKDIR /app
8
+
9
+ # Install system deps required by opencv and pip build tools
10
+ RUN apt-get update && apt-get install -y --no-install-recommends \
11
+ build-essential \
12
+ libgl1-mesa-glx \
13
+ libglib2.0-0 \
14
+ && rm -rf /var/lib/apt/lists/*
15
+
16
+ # Copy requirements and install
17
+ COPY requirements.txt /app/requirements.txt
18
+ RUN pip install --upgrade pip
19
+ RUN pip install -r /app/requirements.txt
20
+
21
+ # Copy app code
22
+ COPY . /app
23
+
24
+ # Ensure a logs directory exists
25
+ RUN mkdir -p /app/logs
26
+
27
+ # Expose the port the app listens on
28
+ EXPOSE 5000
29
+
30
+ # Run with gunicorn for production
31
+ # 'app:app' assumes your Flask file is app.py and Flask app object is named 'app'
32
+ CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "1", "--threads", "4", "app:app"]