Skip to content

Commit

Permalink
Update domserver base to Debian bookworm
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenweyns committed Nov 8, 2023
1 parent f84320c commit 78897a7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
11 changes: 7 additions & 4 deletions docker/domserver/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:bullseye-slim AS domserver-build
FROM debian:bookworm-slim AS domserver-build
LABEL org.opencontainers.image.authors="DOMjudge team <[email protected]>"

ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -12,13 +12,16 @@ RUN apt update \
php-gd php-curl php-mysql php-json php-intl \
php-gmp php-xml php-mbstring \
sudo bsdmainutils ntp libcgroup-dev procps \
python3-sphinx python3-sphinx-rtd-theme python3-pygments rst2pdf fontconfig python3-yaml \
python3-venv fontconfig \
texlive-latex-recommended texlive-latex-extra \
texlive-fonts-recommended texlive-lang-european latexmk \
texlive-fonts-recommended texlive-lang-european latexmk tex-gyre \
libcurl4-gnutls-dev libjsoncpp-dev libmagic-dev \
enscript lpr ca-certificates \
&& rm -rf /var/lib/apt/lists/*

# 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

Expand All @@ -40,7 +43,7 @@ RUN chmod 700 /scripts/patches.sh && /scripts/patches.sh
RUN /domjudge-src/build.sh

# Now create an image with the actual build in it
FROM debian:bullseye-slim
FROM debian:bookworm-slim
LABEL org.opencontainers.image.authors="DOMjudge team <[email protected]>"

ENV DEBIAN_FRONTEND=noninteractive \
Expand Down
7 changes: 5 additions & 2 deletions docker/domserver/build.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/bin/sh -eu

# Use venv to use latest Sphinx. 6.1.0 or higher is required to build DOMjudge docs.
. /venv/bin/activate

cd /domjudge-src/domjudge*
chown -R domjudge: .
# If we used a local source tarball, it might not have been built yet
sudo -u domjudge make dist
sudo -u domjudge sh -c '. /venv/bin/activate && make dist'
sudo -u domjudge ./configure -with-baseurl=http://dj.chipcie.ch.tudelft.nl/

# Passwords should not be included in the built image. We create empty files here to prevent passwords from being generated.
Expand All @@ -25,5 +28,5 @@ then
rm /opt/domjudge/domserver/webapp/.env.local /opt/domjudge/domserver/webapp/.env.local.php
fi

sudo -u domjudge make docs
sudo -u domjudge sh -c '. /venv/bin/activate && make docs'
make install-docs
2 changes: 1 addition & 1 deletion docker/domserver/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ done

# Configure php

php_folder=$(echo "/etc/php/7."?"/")
php_folder=$(echo "/etc/php/8."?"/")
php_version=$(basename "$php_folder")

if [ ! -d "$php_folder" ]
Expand Down

1 comment on commit 78897a7

@maartenweyns
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.