# Use Python 3.9 with Debian Bullseye FROM python:3.9-slim-bullseye # Set environment variables ENV PYTHONUNBUFFERED=1 \ PYTHONDONTWRITEBYTECODE=1 \ DEBIAN_FRONTEND=noninteractive \ PIP_NO_CACHE_DIR=1 \ PIP_DISABLE_PIP_VERSION_CHECK=1 # Install system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ libgl1-mesa-glx \ libglib2.0-0 \ libsm6 \ libxext6 \ libxrender-dev \ libgomp1 \ ffmpeg \ wget \ build-essential \ && rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /app # Upgrade pip and install base packages RUN pip install --upgrade pip setuptools wheel # Copy requirements COPY requirements.txt . # Install Python packages - let pip resolve dependencies automatically RUN pip install \ numpy==1.24.3 \ opencv-python==4.8.1.78 \ opencv-contrib-python==4.8.1.78 \ protobuf==3.20.3 \ tensorflow==2.13.0 \ keras==2.13.1 \ mediapipe==0.10.7 \ cvzone==1.5.6 \ gradio==4.16.0 \ Pillow==10.1.0 \ pyenchant==3.2.2 \ setuptools==65.5.0 # Copy application files COPY app.py . COPY cnn8grps_rad1_model.h5 . COPY white.jpg . # Expose port EXPOSE 7860 # Run the application CMD ["python", "app.py"]