# Imagen de PRUEBAS de Beyond. # # The only thing it adds to the runtime image is a browser. Odoo runs its # JavaScript suites — hoot unit tests AND tours — through browser_js, which # drives a real Chrome in headless mode. Without one, `--test-enable` SKIPS # them silently, and a widget can be dead in the interface while every test # passes. That is not hypothetical: it happened, with the photo menu of # beyond_image_camera. # # NOT the production image and NOT the dev compose: a third artifact, used by # scripts/pruebas.sh and by the CI still pending in docs/despliegue.md. # Producción no lleva navegador. FROM odoo:19@sha256:84d09c623fc78050c2195161b98897995ba68c87aa4212d0ec0f4f3ce88c7610 USER root # Chromium de Playwright, fijado por versión de playwright. Tres candidatos # quedaron descartados por motivos concretos: # · Ubuntu `chromium` / `chromium-browser` en noble es un paquete de # transición a snap (2:1snap1) que no se instala en un contenedor. # · Chrome for Testing publica SOLO linux64 (x86-64), y las máquinas de # desarrollo del proyecto son arm64: no arranca ni con emulación cómoda. # · El repositorio apt de Google sirve siempre «la última», así que la # versión no se puede fijar. # Playwright publica builds de Chromium para arm64 y amd64 bajo la misma # versión, así que ESTE MISMO Dockerfile produce el mismo navegador en la # máquina de desarrollo y en la CI. Se sube a propósito, como el digest. ARG PLAYWRIGHT_VERSION=1.56.0 ENV PLAYWRIGHT_BROWSERS_PATH=/opt/navegador # python3-websocket: sin él Odoo SALTA las pruebas de navegador en vez de # fallar — el verde silencioso que este archivo existe para eliminar. RUN apt-get update \ && apt-get install -y --no-install-recommends \ python3-websocket python3-pip \ ca-certificates fonts-liberation \ libnss3 libnspr4 libdbus-1-3 libatk1.0-0t64 libatk-bridge2.0-0t64 \ libcups2t64 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 \ libxfixes3 libxrandr2 libgbm1 libxshmfence1 libasound2t64 \ libpango-1.0-0 libcairo2 libatspi2.0-0t64 \ && pip3 install --no-cache-dir --break-system-packages \ "playwright==${PLAYWRIGHT_VERSION}" \ && python3 -m playwright install chromium \ && pip3 uninstall -y --break-system-packages playwright \ && apt-get purge -y python3-pip \ && apt-get autoremove -y \ && rm -rf /var/lib/apt/lists/* \ && chmod -R a+rX /opt/navegador # Odoo busca el ejecutable por nombre en PATH: google-chrome, chromium, # chromium-browser o google-chrome-stable (odoo/tests/common.py). RUN ln -sf "$(find /opt/navegador -name chrome -type f | head -1)" \ /usr/local/bin/google-chrome USER odoo