Files
openproject/docker/ci/Dockerfile
T
Eric Schubert 6435804192 [chore] use explicit swiftshader GL for chrome testing
Swiftshader is a software based fallback for WebGL context used in
Chrome without GPU access - e.g. in headless browsers for testing, or
containerized selenium browsers, like in our docker dev setup. The
automatic fallback to Swiftshader was disabled in January 2026, causing
any test using a WebGL context to fail.
See https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/gpu/swiftshader.md
To fix that, we enabled the unsafe fallback now manually for testing
contexts.
2026-01-27 14:48:12 +01:00

53 lines
2.0 KiB
Docker

# syntax=docker/dockerfile:1.4
ARG RUBY_VERSION
FROM ruby:${RUBY_VERSION}-trixie
ENV NODE_VERSION="22.21.0"
ENV DEBIAN_FRONTEND=noninteractive
ENV BUNDLE_WITHOUT="development:production:docker"
ENV PGVERSION=17
RUN apt-get update -qq && \
apt-get install -y wget gnupg lsb-release curl && \
wget --quiet -O- https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /usr/share/keyrings/postgrsql.gpg - && \
echo "deb [signed-by=/usr/share/keyrings/postgrsql.gpg] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
ENV CHROME_SOURCE_URL="https://dl.google.com/dl/linux/direct/google-chrome-stable_current_amd64.deb"
RUN --mount=type=cache,target=/var/cache/apt export f="/tmp/chrome.deb" && \
wget --no-verbose -O $f $CHROME_SOURCE_URL && \
apt-get update -qq && \
apt-get install -y "$f" postgresql-$PGVERSION postgresql-client-$PGVERSION time imagemagick default-jre-headless firefox-esr && \
rm -f "$f" && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/lib/postgresql && \
find /usr/share/locale/* -maxdepth 0 -type d ! -name 'en' -exec rm -rf {} \;
RUN curl -L https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz -o - | tar xJf - -C /usr/local --strip=1 && node --version
RUN rm -rf /usr/local/bundle && gem install bundler --no-document
ENV APP_USER=dev
ENV APP_PATH=/app
ARG APP_USER_UID
ARG APP_USER_GID
RUN groupadd --force --gid $APP_USER_GID $APP_USER && \
useradd -d $APP_PATH -m $APP_USER -s /bin/bash --uid $APP_USER_UID --gid $APP_USER_GID && \
chown -R $APP_USER:$APP_USER /usr/local/bundle
ENV CI=true
ENV RAILS_ENV=test
ENV OPENPROJECT_DISABLE_DEV_ASSET_PROXY=1
ENV CAPYBARA_BIND_ADDRESS=0.0.0.0
ENV CAPYBARA_DOWNLOADED_FILE_DIR=/tmp
# disable deprecations and other warnings in output
ENV RUBYOPT="-W0"
WORKDIR $APP_PATH
USER $APP_USER
RUN mkdir -p ./docker/ci
COPY ./docker/ci/entrypoint.sh ./docker/ci/entrypoint.sh
ENTRYPOINT [ "/app/docker/ci/entrypoint.sh" ]
CMD ["setup-tests", "bash"]