| FROM python:3.9-slim | |
| # Install system dependencies for building PyQt5 and OpenCV | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| libgl1-mesa-glx \ | |
| libglib2.0-0 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set the working directory | |
| WORKDIR /app | |
| # Copy requirements and install Python dependencies | |
| COPY requirements.txt ./ | |
| RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt | |
| # Copy the rest of the application code | |
| COPY . . | |
| # Expose the port (adjust if needed) | |
| EXPOSE 7890 | |
| # Set environment variables for a Flask app | |
| ENV FLASK_APP=app.py | |
| ENV FLASK_RUN_HOST=0.0.0.0 | |
| # Command to run the application | |
| CMD ["flask", "run", "--port=7890"] | |