FROM ghcr.io/pyo3/maturin AS builder ADD . . RUN /usr/bin/maturin build --release --interpreter python3.11 FROM docker.io/library/python:3.11-slim-bullseye RUN apt-get update RUN useradd -m -u 1000 user USER user WORKDIR /home/user/app COPY . /home/user/app/ RUN pip install --user --upgrade pip RUN pip install -r requirements.txt EXPOSE 7860 CMD ["python", "index.py", "production"]