aboutsummaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorPhilipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de>2024-09-24 10:53:31 +0200
committerPhilipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de>2024-09-24 10:53:31 +0200
commit4459dd7917f4d1c34f40bb68f0e991e9c3d53e4c (patch)
tree5c07151ae61276d334e88f6309c30d439a85c12e /docker
parentda0022e5c1abbf9825ae76debaabdff7e8623bb4 (diff)
parent97a188592c679890a25c37ab78463add76a52ff7 (diff)
Merge branch 'main' into issue-3911issue-3911
Diffstat (limited to 'docker')
-rwxr-xr-x[-rw-r--r--]docker/build_images.sh3
-rw-r--r--docker/studip/Dockerfile17
-rw-r--r--docker/studip/Dockerfile-Dev12
-rw-r--r--docker/studip/config_local.php64
-rw-r--r--docker/studip/docker-entrypoint.sh13
-rw-r--r--docker/studip/my.cnf12
-rw-r--r--docker/tests/php74/Dockerfile7
-rw-r--r--docker/tests/php81/Dockerfile25
-rw-r--r--docker/tests/php82/Dockerfile12
-rw-r--r--docker/tests/php83/Dockerfile25
10 files changed, 128 insertions, 62 deletions
diff --git a/docker/build_images.sh b/docker/build_images.sh
index f8feb9f..cc03883 100644..100755
--- a/docker/build_images.sh
+++ b/docker/build_images.sh
@@ -9,8 +9,9 @@ build_image () {
fi
}
+build_image tests/php83 studip:tests-php8.3 &
build_image tests/php82 studip:tests-php8.2 &
-build_image tests/php74 studip:tests-php7.4 &
+build_image tests/php81 studip:tests-php8.1 &
build_image release-cli release-cli &
wait
diff --git a/docker/studip/Dockerfile b/docker/studip/Dockerfile
index 8ee1d20..daa52e6 100644
--- a/docker/studip/Dockerfile
+++ b/docker/studip/Dockerfile
@@ -1,5 +1,5 @@
# Setup php, apache and stud.ip
-FROM php:7.4-apache as base
+FROM php:8.1-apache as base
# Install system requirements
RUN apt update && apt install -y --no-install-recommends \
@@ -11,14 +11,22 @@ RUN apt update && apt install -y --no-install-recommends \
libonig-dev \
libzip-dev \
libicu-dev \
+ libwebp-dev \
+ locales \
vim \
&& rm -rf /var/lib/apt/lists/*
+# Install locales
+RUN sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen \
+ && sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen \
+ && dpkg-reconfigure --frontend=noninteractive locales \
+ && update-locale
+
# Install php extensions
-RUN docker-php-ext-configure gd --with-jpeg
-RUN docker-php-ext-install pdo gettext curl gd mbstring zip pdo pdo_mysql mysqli intl json
+RUN docker-php-ext-configure gd --with-jpeg --with-webp
+RUN docker-php-ext-install gettext gd zip pdo_mysql mysqli intl
-FROM node:16 as nodejs
+FROM node:18 as nodejs
# Install node modules
COPY . /studip
@@ -59,5 +67,6 @@ COPY ./docker/studip/docker-entrypoint.sh /usr/local/bin/
RUN chmod u+x /usr/local/bin/docker-entrypoint.sh
# Set start parameters
+ENV AUTO_MIGRATE 1
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["apache2-foreground"]
diff --git a/docker/studip/Dockerfile-Dev b/docker/studip/Dockerfile-Dev
index 960bd97..28e112b 100644
--- a/docker/studip/Dockerfile-Dev
+++ b/docker/studip/Dockerfile-Dev
@@ -11,11 +11,19 @@ RUN apt update && apt install -y --no-install-recommends \
libonig-dev \
libzip-dev \
libicu-dev \
+ libwebp-dev \
+ locales \
vim \
&& rm -rf /var/lib/apt/lists/*
+# Install locales
+RUN sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen \
+ && sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen \
+ && dpkg-reconfigure --frontend=noninteractive locales \
+ && update-locale
+
# Install php extensions
-RUN docker-php-ext-configure gd --with-jpeg
+RUN docker-php-ext-configure gd --with-jpeg --with-webp
RUN docker-php-ext-install pdo gettext curl gd mbstring zip pdo pdo_mysql mysqli intl json
@@ -35,4 +43,4 @@ RUN chmod u+x /usr/local/bin/docker-entrypoint.sh
# Set start parameters
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
-CMD ["apache2-foreground"] \ No newline at end of file
+CMD ["apache2-foreground"]
diff --git a/docker/studip/config_local.php b/docker/studip/config_local.php
index 010ff66..63029e7 100644
--- a/docker/studip/config_local.php
+++ b/docker/studip/config_local.php
@@ -1,49 +1,27 @@
<?php
-/*basic settings for Stud.IP
-----------------------------------------------------------------
-you find here the basic system settings. You shouldn't have to touch much of them...
-please note the CONFIG.INC.PHP for the indivual settings of your installation!*/
-
-namespace Studip {
- //const ENV = 'development';
- define ('ENV', getenv('ENV') ?? 'development');
-}
-
-namespace {
- /*settings for database access
- ----------------------------------------------------------------
- please fill in your database connection settings.
- */
+define ('Studip\\ENV', $_ENV['ENV'] ?? 'development');
- // default Stud.IP database (DB_Seminar)
- $DB_STUDIP_HOST = getenv('MYSQL_HOST');
- $DB_STUDIP_USER = getenv('MYSQL_USER');
- $DB_STUDIP_PASSWORD = getenv('MYSQL_PASSWORD');
- $DB_STUDIP_DATABASE = getenv('MYSQL_DATABASE');
- $MAIL_TRANSPORT = getenv('MAIL_TRANSPORT');
+error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
- /*URL
- ----------------------------------------------------------------
- customize if automatic detection fails, e.g. when installation is hidden
- behind a proxy
- */
- //$CANONICAL_RELATIVE_PATH_STUDIP = '/';
- //$ABSOLUTE_URI_STUDIP = 'https://www.studip.de/';
- //$ASSETS_URL = 'https://www.studip.de/assets/';
-
- // Set proxy url
- if ($PROXY_URL = getenv('PROXY_URL')) {
- $ABSOLUTE_URI_STUDIP = $PROXY_URL;
- $ASSETS_URL = $PROXY_URL.'/assets/';
- unset($PROXY_URL);
- }
+/*URL
+----------------------------------------------------------------
+customize if automatic detection fails, e.g. when installation is hidden
+behind a proxy
+*/
+//$CANONICAL_RELATIVE_PATH_STUDIP = '/';
+//$ABSOLUTE_URI_STUDIP = 'https://www.studip.de/';
+//$ASSETS_URL = 'https://www.studip.de/assets/';
- // Use autoproxy
- if (getenv('AUTO_PROXY')) {
- $ABSOLUTE_URI_STUDIP = $_SERVER['HTTP_X_FORWARDED_PROTO'].'://'.$_SERVER['HTTP_X_FORWARDED_HOST'].'/';
- $ASSETS_URL = $ABSOLUTE_URI_STUDIP.'/assets/';
- }
- $MAIL_TRANSPORT = getenv('STUDIP_MAIL_TRANSPORT');
+// Set proxy url
+if (isset($_ENV['PROXY_URL'])) {
+ $ABSOLUTE_URI_STUDIP = $_ENV['PROXY_URL'];
+ $ASSETS_URL = $_ENV['PROXY_URL'].'/assets/';
+}
- $CONTENT_LANGUAGES['en_GB'] = ['picture' => 'lang_en.gif', 'name' => 'English'];
+// Use autoproxy
+if (isset($_ENV['AUTO_PROXY'])) {
+ $ABSOLUTE_URI_STUDIP = $_SERVER['HTTP_X_FORWARDED_PROTO'].'://'.$_SERVER['HTTP_X_FORWARDED_HOST'].'/';
+ $ASSETS_URL = $ABSOLUTE_URI_STUDIP.'/assets/';
}
+
+$CONTENT_LANGUAGES['en_GB'] = ['picture' => 'lang_en.gif', 'name' => 'English'];
diff --git a/docker/studip/docker-entrypoint.sh b/docker/studip/docker-entrypoint.sh
index bafc2fe..dde57c5 100644
--- a/docker/studip/docker-entrypoint.sh
+++ b/docker/studip/docker-entrypoint.sh
@@ -28,17 +28,22 @@ done
sh $STUDIP/.gitlab/scripts/install_db.sh
-if [ ! -z $AUTO_MIGRATE ]; then
+if [[ -n $AUTO_MIGRATE ]]; then
echo "Migrate Instance"
# If migrate fails start instance anyway
- php "$STUDIP/cli/studip migrate" || true
+ php "$STUDIP/cli/studip" migrate || true
echo "Migration finished"
fi
# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
- set -- apache2-foreground "$@"
+ set -- apache2-foreground "$@"
fi
-exec "$@"
+# Set name of installation if set
+if [[ -n "$STUDIP_NAME" ]]; then
+ echo "Setting installation name"
+ php "$STUDIP/cli/studip" config:set UNI_NAME_CLEAN "$STUDIP_NAME"
+fi
+exec "$@"
diff --git a/docker/studip/my.cnf b/docker/studip/my.cnf
new file mode 100644
index 0000000..c5607a4
--- /dev/null
+++ b/docker/studip/my.cnf
@@ -0,0 +1,12 @@
+[client]
+default-character-set = utf8mb4
+
+[mysql]
+default-character-set = utf8mb4
+
+[mysqld]
+character-set-server = utf8mb4
+collation-server = utf8mb4_unicode_ci
+
+innodb_file_per_table = On
+sql_mode = NO_ENGINE_SUBSTITUTION
diff --git a/docker/tests/php74/Dockerfile b/docker/tests/php74/Dockerfile
index 49149a9..17d404a 100644
--- a/docker/tests/php74/Dockerfile
+++ b/docker/tests/php74/Dockerfile
@@ -7,14 +7,15 @@ RUN apt update && apt install -y --no-install-recommends \
lsb-release \
zip \
tar \
+ libwebp-dev \
&& rm -rf /var/lib/apt/lists/*
# Install php extensions
-RUN docker-php-ext-configure gd --with-jpeg
+RUN docker-php-ext-configure gd --with-jpeg --with-webp
RUN docker-php-ext-install pdo gettext curl gd mbstring zip pdo pdo_mysql mysqli intl json
-# Install npm using nvm
-RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
+# Install node
+RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
RUN apt update && apt install -y --no-install-recommends nodejs \
curl apt-transport-https ca-certificates gnupg unzip git \
&& rm -rf /var/lib/apt/lists/*
diff --git a/docker/tests/php81/Dockerfile b/docker/tests/php81/Dockerfile
new file mode 100644
index 0000000..bcd805a
--- /dev/null
+++ b/docker/tests/php81/Dockerfile
@@ -0,0 +1,25 @@
+# Setup php, apache and stud.ip
+FROM php:8.1-cli
+
+# Install system requirements
+RUN apt update && apt install -y --no-install-recommends \
+ default-mysql-client default-libmysqlclient-dev \
+ zlib1g-dev libpng-dev libjpeg-dev libonig-dev libzip-dev libicu-dev \
+ lsb-release \
+ zip \
+ tar \
+ libwebp-dev \
+ && rm -rf /var/lib/apt/lists/*
+
+# Install php extensions
+RUN docker-php-ext-configure gd --with-jpeg=/usr/include/ --with-webp
+RUN docker-php-ext-install -j$(nproc) gd gettext intl mysqli pdo pdo_mysql zip
+
+# Install node/npm
+RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
+RUN apt update && apt install -y --no-install-recommends nodejs \
+ curl apt-transport-https ca-certificates gnupg unzip git \
+ && rm -rf /var/lib/apt/lists/*
+
+# Install composer
+COPY --from=composer /usr/bin/composer /usr/bin/composer
diff --git a/docker/tests/php82/Dockerfile b/docker/tests/php82/Dockerfile
index f1a5793..7f18e4e 100644
--- a/docker/tests/php82/Dockerfile
+++ b/docker/tests/php82/Dockerfile
@@ -3,18 +3,20 @@ FROM php:8.2-cli
# Install system requirements
RUN apt update && apt install -y --no-install-recommends \
- default-mysql-client default-libmysqlclient-dev libcurl4-openssl-dev zlib1g-dev libpng-dev libjpeg-dev libonig-dev libzip-dev libicu-dev \
+ default-mysql-client default-libmysqlclient-dev \
+ zlib1g-dev libpng-dev libjpeg-dev libonig-dev libzip-dev libicu-dev \
lsb-release \
zip \
tar \
+ libwebp-dev \
&& rm -rf /var/lib/apt/lists/*
# Install php extensions
-RUN docker-php-ext-configure gd --with-jpeg=/usr/include/
-RUN docker-php-ext-install -j$(nproc) pdo gettext curl gd mbstring zip pdo pdo_mysql mysqli intl
+RUN docker-php-ext-configure gd --with-jpeg=/usr/include/ --with-webp
+RUN docker-php-ext-install -j$(nproc) gd gettext intl mysqli pdo pdo_mysql zip
-# Install npm using nvm
-RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
+# Install node/npm
+RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
RUN apt update && apt install -y --no-install-recommends nodejs \
curl apt-transport-https ca-certificates gnupg unzip git \
&& rm -rf /var/lib/apt/lists/*
diff --git a/docker/tests/php83/Dockerfile b/docker/tests/php83/Dockerfile
new file mode 100644
index 0000000..54bb541
--- /dev/null
+++ b/docker/tests/php83/Dockerfile
@@ -0,0 +1,25 @@
+# Setup php, apache and stud.ip
+FROM php:8.3-cli
+
+# Install system requirements
+RUN apt update && apt install -y --no-install-recommends \
+ default-mysql-client default-libmysqlclient-dev \
+ zlib1g-dev libpng-dev libjpeg-dev libonig-dev libzip-dev libicu-dev \
+ lsb-release \
+ zip \
+ tar \
+ libwebp-dev \
+ && rm -rf /var/lib/apt/lists/*
+
+# Install php extensions
+RUN docker-php-ext-configure gd --with-jpeg=/usr/include/ --with-webp
+RUN docker-php-ext-install -j$(nproc) gd gettext intl mysqli pdo_mysql zip
+
+# Install node/npm
+RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
+RUN apt update && apt install -y --no-install-recommends nodejs \
+ curl apt-transport-https ca-certificates gnupg unzip git \
+ && rm -rf /var/lib/apt/lists/*
+
+# Install composer
+COPY --from=composer /usr/bin/composer /usr/bin/composer