arshtech commited on
Commit
7d11b17
·
verified ·
1 Parent(s): 72d0dbf

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -18
Dockerfile CHANGED
@@ -1,34 +1,22 @@
1
- # Use official Python runtime as base image
2
  FROM python:3.9-slim
3
 
4
- # Set working directory in container
5
  WORKDIR /app
6
 
7
  # Install system dependencies
8
  RUN apt-get update && apt-get install -y \
9
  libgl1 \
10
  libglib2.0-0 \
 
 
 
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
- # Copy requirements first to leverage Docker cache
14
  COPY requirements.txt .
15
-
16
- # Install Python dependencies
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
19
- # Copy application code
20
- COPY app.py .
21
- COPY templates/ ./templates/
22
-
23
- # Create directory for OpenCV Haar cascades
24
- RUN mkdir -p /usr/share/opencv4/haarcascades/
25
 
26
- # Expose port
27
  EXPOSE 5000
28
 
29
- # Set environment variables
30
- ENV FLASK_APP=app.py
31
- ENV FLASK_ENV=production
32
-
33
- # Run the application
34
- CMD ["python", "app.py"]
 
 
1
  FROM python:3.9-slim
2
 
 
3
  WORKDIR /app
4
 
5
  # Install system dependencies
6
  RUN apt-get update && apt-get install -y \
7
  libgl1 \
8
  libglib2.0-0 \
9
+ libsm6 \
10
+ libxext6 \
11
+ libxrender-dev \
12
  && rm -rf /var/lib/apt/lists/*
13
 
 
14
  COPY requirements.txt .
 
 
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
+ COPY . .
 
 
 
 
 
18
 
 
19
  EXPOSE 5000
20
 
21
+ # Use this for better debugging
22
+ CMD ["python", "-u", "app.py"]