diff --git a/.github/workflows/build-contributor-container-PR.yml b/.github/workflows/build-contributor-container-PR.yml index ecd2e2c..f1c6cab 100644 --- a/.github/workflows/build-contributor-container-PR.yml +++ b/.github/workflows/build-contributor-container-PR.yml @@ -5,13 +5,13 @@ name: 'Build Contributor container (PR)' on: push: paths: - - docker-contributor + - docker-contributor/** - .github/workflows/build-contributor-container-PR.yml pull_request: branches: - main paths: - - docker-contributor + - docker-contributor/** - .github/workflows/build-contributor-container-PR.yml jobs: diff --git a/.github/workflows/build-domjudge-container-PR.yml b/.github/workflows/build-domjudge-container-PR.yml index 0f5403d..ca9e5c9 100644 --- a/.github/workflows/build-domjudge-container-PR.yml +++ b/.github/workflows/build-domjudge-container-PR.yml @@ -4,13 +4,13 @@ on: push: paths: - .github/workflows/build-domjudge-container-PR.yml - - docker + - docker/** pull_request: branches: - main paths: - .github/workflows/build-domjudge-container-PR.yml - - docker + - docker/** env: DOMJUDGE_VERSION: M.m.p diff --git a/.github/workflows/build-gitlab-container-PR.yml b/.github/workflows/build-gitlab-container-PR.yml index 776830c..662580e 100644 --- a/.github/workflows/build-gitlab-container-PR.yml +++ b/.github/workflows/build-gitlab-container-PR.yml @@ -4,14 +4,14 @@ on: push: paths: - docker-contributor/php-config - - docker-gitlabci + - docker-gitlabci/** - .github/workflows/build-gitlab-container-PR.yml pull_request: branches: - main paths: - docker-contributor/php-config - - docker-gitlabci + - docker-gitlabci/** - .github/workflows/build-gitlab-container-PR.yml jobs: diff --git a/docker/domserver/Dockerfile b/docker/domserver/Dockerfile index 1ca2764..4964247 100644 --- a/docker/domserver/Dockerfile +++ b/docker/domserver/Dockerfile @@ -3,6 +3,10 @@ LABEL org.opencontainers.image.authors="DOMjudge team " ENV DEBIAN_FRONTEND=noninteractive +# Set up user +RUN groupadd domjudge -g2004 +RUN useradd -m domjudge -u2004 -g2004 + # Install required packages for build of domserver RUN apt-get update \ && apt-get install --no-install-recommends --no-install-suggests -y \ @@ -22,9 +26,6 @@ RUN apt-get update \ # Use venv to install latest Sphinx. 6.1.0 or higher is required to build DOMjudge docs. RUN python3 -m venv /venv && . /venv/bin/activate && pip3 install sphinx sphinx-rtd-theme rst2pdf -# Set up user -RUN useradd -m domjudge - # Install composer RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ && php composer-setup.php \ @@ -58,18 +59,13 @@ RUN useradd -m domjudge RUN apt-get update \ && apt-get install --no-install-recommends --no-install-suggests -y \ acl curl zip unzip supervisor mariadb-client apache2-utils \ - nginx php-cli php-fpm php-zip \ + nginx php-cli php-fpm php-zip composer \ php-gd php-curl php-mysql php-json php-intl \ php-gmp php-xml php-mbstring php-ldap \ enscript lpr \ ca-certificates python3-yaml python3-requests \ && rm -rf /var/lib/apt/lists/* -# Install composer -RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ - && php composer-setup.php \ - && mv /composer.phar /usr/local/bin/composer - # Copy domserver COPY --from=domserver-build /opt/domjudge/domserver /opt/domjudge/domserver COPY --from=domserver-build /opt/domjudge/doc /opt/domjudge/doc diff --git a/docker/judgehost/Dockerfile b/docker/judgehost/Dockerfile index bda39f0..8fdeaf5 100644 --- a/docker/judgehost/Dockerfile +++ b/docker/judgehost/Dockerfile @@ -11,7 +11,8 @@ ENV DEBIAN_FRONTEND=noninteractive \ RUN_USER_UID_GID=62860 # Set up user -RUN useradd -m domjudge +RUN groupadd domjudge -g2004 +RUN useradd -m domjudge -u2004 -g2004 # Install required packages for running of judgehost RUN apt-get update \ diff --git a/docker/judgehost/Dockerfile.build b/docker/judgehost/Dockerfile.build index 716dda5..817a2f0 100644 --- a/docker/judgehost/Dockerfile.build +++ b/docker/judgehost/Dockerfile.build @@ -3,6 +3,10 @@ LABEL org.opencontainers.image.authors="DOMjudge team " ENV DEBIAN_FRONTEND=noninteractive +# Set up user +RUN groupadd domjudge -g2004 +RUN useradd -m domjudge -u2004 -g2004 + # Install required packages for build of judgehost RUN apt-get update \ && apt-get install --no-install-recommends --no-install-suggests -y \ @@ -10,21 +14,12 @@ RUN apt-get update \ gcc g++ make zip unzip \ php-cli php-zip lsb-release debootstrap \ php-gd php-curl php-mysql php-json \ - php-gmp php-xml php-mbstring \ + php-gmp php-xml php-mbstring composer \ sudo bsdmainutils ntp libcgroup-dev procps \ libcurl4-gnutls-dev libjsoncpp-dev libmagic-dev \ ca-certificates \ && rm -rf /var/lib/apt/lists/* -# Set up user -RUN useradd -m domjudge - -# Install composer - -RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ - && php composer-setup.php \ - && mv /composer.phar /usr/local/bin/composer - # Add DOMjudge source code and build script ADD domjudge.tar.gz /domjudge-src ADD judgehost/build.sh /domjudge-src