FROM python:3.11-slim # Install uv COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv # Set up the application directory WORKDIR /app # Copy your dependency files from the subdirectory to the container # Adjust 'pyproject.toml' or 'uv.lock' to match your actual file names COPY pyproject.toml uv.lock* /app/ # Install dependencies into the system python RUN uv sync # Copy the rest of your code COPY . /app/ RUN useradd -m -u 1000 user USER user ENV PATH="/app/.venv/bin:$PATH" COPY --chown=user . /app EXPOSE 7860 ENV GRADIO_SERVER_NAME="0.0.0.0" # Run the application # Note: We point to server.app because we are inside /app/ CMD ["uv", "run", "main.py"]