FROM python:3.12-slim ENV PYTHONUNBUFFERED=1 WORKDIR /app # Install system deps required by numpy/pandas/matplotlib and building wheels RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ gcc \ gfortran \ libatlas3-base \ libopenblas-dev \ liblapack-dev \ libfreetype6-dev \ libpng-dev \ pkg-config \ ca-certificates \ curl \ git \ libglib2.0-0 \ libxrender1 \ libxext6 \ libsm6 \ && rm -rf /var/lib/apt/lists/* # Copy only requirements first for better layer caching COPY requirements.txt /app/requirements.txt # Upgrade pip and install python deps RUN python -m pip install --upgrade pip setuptools wheel && \ python -m pip install -r /app/requirements.txt # Copy project COPY . /app # Ensure Python and dynamic linker will find the native libs if mounted ENV PYTHONPATH="/app:/app/IPM_SO:/app/IPM_DLL" ENV LD_LIBRARY_PATH="/app/IPM_SO:/app/IPM_DLL" EXPOSE 8001 # Default command runs uvicorn (use docker-compose override for development) CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8001"]