FROM python:3.10-slim # 1. Install pydantic v1 before anything else RUN pip install --no-cache-dir pydantic==1.10.7 # 2. Copy your requirements.txt COPY requirements.txt /tmp/requirements.txt # 3. Install the rest of your dependencies RUN pip install --no-cache-dir -r /tmp/requirements.txt # 4. Copy your app code COPY . /home/user/app WORKDIR /home/user/app # 5. Expose streamlit or gradio or whichever port your app uses EXPOSE 7860 # 6. Run your app CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]