FROM tensorflow/tensorflow:2.16.1-jupyter WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential gfortran libblas-dev liblapack-dev \ libffi-dev libssl-dev libbz2-dev liblzma-dev zlib1g-dev \ libncurses5-dev libncursesw5-dev libreadline-dev curl git \ && rm -rf /var/lib/apt/lists/* # Copy requirements first for caching COPY requirements.txt . # Upgrade pip and install all dependencies RUN pip install --no-cache-dir -r requirements.txt # Copy app source COPY . . # Expose Flask port EXPOSE 7860 # Run Flask API CMD ["python", "app.py"]