# Base image FROM python:3.12.9 # Create a non-root user and switch to it RUN useradd -m -u 1000 user USER user # Set environment path ENV PATH="/home/user/.local/bin:$PATH" # Working directory WORKDIR /app # Install dependencies COPY --chown=user ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt # Copy the entire app COPY --chown=user . /app # Launch the app (adjusted path!) CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]