FROM almalinux:8
RUN dnf -y install epel-release && dnf -y install python3.11 python3.11-pip python3.11-devel gcc gcc-c++ binutils rpm-build git tar xz mesa-libGL mesa-libEGL libX11 libXext libXrender libXcursor libXi libxcb libxkbcommon-x11 xcb-util-cursor xcb-util-image xcb-util-keysyms xcb-util-renderutil xcb-util-wm fontconfig freetype dbus-libs alsa-lib dejavu-sans-fonts && dnf clean all
WORKDIR /src
COPY . .
RUN python3.11 -m pip install --upgrade pip && python3.11 -m pip install -e '.[dev]'
ENV QT_QPA_PLATFORM=offscreen
RUN python3.11 -m pytest -q tests/test_release_101.py tests/test_release_11.py tests/test_object_edit_performance.py tests/test_chrome_stability.py tests/test_text_responsiveness.py tests/test_graphics_roundtrip.py tests/test_image_roundtrip.py tests/test_ui_graphics.py tests/test_pdf_workflows.py tests/test_preservation.py tests/test_release_120.py tests/test_release_121.py tests/test_forms.py tests/test_markdown_reading.py tests/test_reading_132.py tests/test_reading_131.py -k 'not video_selection_layer_and_playback and not video_one_click_pause_resume_and_no_canvas_bubbling'
RUN python3.11 scripts/collect_licenses.py && python3.11 -m PyInstaller --noconfirm AsterPDF.spec && python3.11 scripts/linux_packages.py
