# Use a Python base image FROM python:3.11-slim # Create user and working directory RUN useradd -m -u 1000 user USER user ENV PATH="/home/user/.local/bin:$PATH" WORKDIR /app # Copy and install dependencies COPY --chown=user ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir -r requirements.txt # Copy app files COPY --chown=user . /app # Expose the desired port EXPOSE 7860 # Launch app with uvicorn CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]