It turned out the error I needed to research specifically was ERROR:zygote_host_impl_linux.cc(100). I found a solution here:
https://stackoverflow.com/questions/62284578/docker-errorzygote-host-impl-linux-cc89-running-as-root-without-no-sandb
And the new Dockerfile is
# Use the official Python base image
FROM python:3.11-bullseye
RUN pip install numpy && pip install setuptools
# Copy the debPackages.txt file
COPY debPackages.txt .
# Install Qt6 dependencies
RUN apt-get update && apt-get install $(grep -vE "^\s*#" debPackages.txt | tr "\n" " ") -y
# Set the working directory in the container
WORKDIR /app
# Copy the requirements.txt file
COPY requirements.txt .
# Upgrade pip
RUN pip install --upgrade pip
# Install the Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the project files
COPY . .
ENV PYTHONDONTWRITEBYTECODE=true
# Export QT specific settings
ENV QT_DEBUG_PLUGINS=1
ENV QT_QPA_PLATFORM=offscreen
ENV QTWEBENGINE_DISABLE_SANDBOX=1
RUN pip install .
# Expose the port the application runs on
EXPOSE 8000
CMD ["coverage", "run", "-m", "pytest"]
so adding ENV QTWEBENGINE_DISABLE_SANDBOX=1 fixed everything.