File size: 612 Bytes
017cd1f
aff26b0
 
96901e3
 
 
 
017cd1f
96901e3
 
017cd1f
 
 
 
 
aff26b0
 
017cd1f
aff26b0
 
 
017cd1f
aff26b0
 
017cd1f
aff26b0
 
017cd1f
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Use official Python slim image
FROM python:3.11-slim

# Install system dependencies for OpenCV
RUN apt-get update && apt-get install -y \
    libgl1 \
    libglib2.0-0 \
    ffmpeg \
    && rm -rf /var/lib/apt/lists/*

# Set environment variables to avoid permission issues
ENV YOLO_CONFIG_DIR=/tmp/Ultralytics
ENV MPLCONFIGDIR=/tmp/matplotlib

# Set working directory
WORKDIR /app

# Copy and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the application code
COPY . .

# Expose Flask port
EXPOSE 7860

# Run Flask app
CMD ["python", "app.py"]