forked from DOMjudge/domjudge-packaging
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from WISVCH/merge-upstream
- Loading branch information
Showing
25 changed files
with
322 additions
and
287 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,6 @@ on: | |
pull_request: | ||
branches: | ||
- main | ||
pull_request_target: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
shellcheck: | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
ARG ARCH= | ||
FROM "${ARCH}ubuntu:jammy" | ||
FROM "${ARCH}ubuntu:noble" | ||
LABEL maintainer="DOMjudge team <[email protected]>" | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive \ | ||
CONTAINER_TIMEZONE=Europe/Amsterdam \ | ||
UID=1000 \ | ||
GID=1000 \ | ||
MYSQL_HOST=mariadb \ | ||
MYSQL_USER=domjudge \ | ||
MYSQL_DATABASE=domjudge \ | ||
|
@@ -12,25 +14,26 @@ ENV DEBIAN_FRONTEND=noninteractive \ | |
FPM_MAX_CHILDREN=40 \ | ||
DJ_SKIP_MAKE=0 \ | ||
DJ_DB_INSTALL_BARE=0 \ | ||
PHPSUPPORTED="7.2 7.3 7.4 8.0 8.1 8.2" \ | ||
DEFAULTPHPVERSION="8.1" \ | ||
APTINSTALL="apt install -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold" | ||
PHPSUPPORTED="8.1 8.2 8.3 8.4" \ | ||
DEFAULTPHPVERSION="8.4" \ | ||
DEFAULTWEBSERVER="nginx" \ | ||
APTINSTALL="apt-get install -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold" | ||
|
||
# Install required packages and clean up afterwards to make this image layer smaller | ||
RUN apt update \ | ||
&& apt install --no-install-recommends --no-install-suggests -y \ | ||
dumb-init autoconf automake git acl \ | ||
RUN apt-get update \ | ||
&& apt-get install --no-install-recommends --no-install-suggests -y \ | ||
curl dumb-init autoconf automake git acl \ | ||
gcc g++ make zip unzip mariadb-client \ | ||
nginx php8.1 php8.1-cli php8.1-fpm php8.1-zip \ | ||
php8.1-gd php8.1-curl php8.1-mysql php8.1-intl \ | ||
php8.1-gmp php8.1-xml php8.1-mbstring php8.1-xdebug php8.1-pcov \ | ||
bsdmainutils ntp \ | ||
nginx php8.3 php8.3-cli php8.3-fpm php8.3-zip \ | ||
php8.3-gd php8.3-curl php8.3-mysql php8.3-intl \ | ||
php8.3-gmp php8.3-xml php8.3-mbstring php8.3-xdebug php8.3-pcov \ | ||
bsdmainutils ntp lsof \ | ||
linuxdoc-tools linuxdoc-tools-text groff \ | ||
python3-sphinx python3-sphinx-rtd-theme python3-pip fontconfig python3-yaml \ | ||
texlive-latex-recommended texlive-latex-extra \ | ||
texlive-fonts-recommended texlive-lang-european latexmk \ | ||
sudo debootstrap libcgroup-dev procps \ | ||
default-jre-headless default-jdk \ | ||
default-jre-headless default-jdk-headless \ | ||
supervisor apache2-utils lsb-release \ | ||
libcurl4-gnutls-dev libjsoncpp-dev libmagic-dev \ | ||
enscript lpr ca-certificates less vim \ | ||
|
@@ -42,36 +45,37 @@ RUN ln -sf /dev/stdout /var/log/nginx/access.log \ | |
&& ln -sf /dev/stderr /var/log/nginx/error.log \ | ||
&& mkdir -p /run/php | ||
|
||
# Remove default ubuntu user | ||
RUN userdel ubuntu && groupdel ubuntu || true | ||
# Set up users | ||
RUN useradd -m domjudge \ | ||
RUN groupadd -g $GID domjudge \ | ||
&& useradd -u $UID -g $GID -m domjudge \ | ||
&& groupadd domjudge-run \ | ||
&& for id in $(seq 0 4); do useradd -d /nonexistent -g nogroup -s /bin/false "domjudge-run-$id"; done | ||
|
||
# Install composer | ||
RUN apt update && \ | ||
apt install --no-install-recommends --no-install-suggests -y ca-certificates \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php composer-setup.php \ | ||
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php composer-setup.php \ | ||
&& mv /composer.phar /usr/local/bin/composer | ||
|
||
# Install all supported PHP versions | ||
RUN add-apt-repository ppa:ondrej/php -y && apt update | ||
RUN for VERSION in $PHPSUPPORTED; do \ | ||
if [ "${VERSION}" != "8.1" ]; then \ | ||
RUN add-apt-repository ppa:ondrej/php -y && apt-get update && \ | ||
for VERSION in $PHPSUPPORTED; do \ | ||
if [ "${VERSION}" != "8.3" ]; then \ | ||
$APTINSTALL php${VERSION}; \ | ||
fi; \ | ||
done | ||
RUN PACKAGES=$(dpkg-query -f '${binary:Package}\n' -W|grep "^php.*-"); \ | ||
done && \ | ||
PACKAGES=$(dpkg-query -f '${binary:Package}\n' -W|grep "^php.*-") && \ | ||
for PACKAGE in $PACKAGES; do \ | ||
PACKAGEALLVERSIONS="" && \ | ||
for VERSION in $PHPSUPPORTED; do \ | ||
if [ "${VERSION}" != "8.1" ]; then \ | ||
if [ "${VERSION}" != "8.3" ]; then \ | ||
PACKAGEALLVERSIONS="$PACKAGEALLVERSIONS php${VERSION}-${PACKAGE#php*-}"; \ | ||
fi; \ | ||
done; \ | ||
$APTINSTALL $PACKAGEALLVERSIONS; \ | ||
done | ||
RUN update-alternatives --set php /usr/bin/php${DEFAULTPHPVERSION} | ||
done && \ | ||
update-alternatives --set php /usr/bin/php${DEFAULTPHPVERSION} && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Set up alternatives for PHP-FPM | ||
RUN for VERSION in $PHPSUPPORTED; do \ | ||
|
@@ -86,9 +90,25 @@ COPY ["php-config", "/php-config"] | |
RUN for VERSION in $PHPSUPPORTED; do \ | ||
cp -Rf /php-config/* /etc/php/${VERSION}/cli/conf.d; \ | ||
cp -Rf /php-config/* /etc/php/${VERSION}/fpm/conf.d; \ | ||
done; \ | ||
done; \ | ||
rm -Rf /php-config | ||
|
||
# Install blackfire probe | ||
RUN for VERSION in $PHPSUPPORTED; do \ | ||
# Blackfire is not available yet for PHP 8.4 | ||
if [ "${VERSION}" != "8.4" ]; then \ | ||
version=$(php${VERSION} -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION.(PHP_ZTS ? '-zts' : '');") \ | ||
&& architecture=$(uname -m) \ | ||
&& curl -v -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/$architecture/$version \ | ||
&& mkdir -p /tmp/blackfire \ | ||
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \ | ||
&& mv /tmp/blackfire/blackfire-*.so $(php${VERSION} -r "echo ini_get ('extension_dir');")/blackfire.so \ | ||
&& printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8307\n" > /etc/php/${VERSION}/fpm/conf.d/blackfire.ini \ | ||
&& printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8307\n" > /etc/php/${VERSION}/cli/conf.d/blackfire.ini \ | ||
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz; \ | ||
fi; \ | ||
done | ||
|
||
# Disable Xdebug by default | ||
RUN phpdismod xdebug | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
supervisorctl tail -f apache2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
supervisorctl tail -f apache2 stderr |
Oops, something went wrong.