diff --git a/config/docker-files/7.2-Dockerfile b/config/docker-files/7.2-Dockerfile index b9d267ace2f7002ccf2a07f92d62aa963f7f31be..18405ca3ac16379eae8b51661d9d7246149ccc4b 100644 --- a/config/docker-files/7.2-Dockerfile +++ b/config/docker-files/7.2-Dockerfile @@ -2,6 +2,7 @@ FROM php:7.2-fpm # Install system requirements RUN apt update && apt install -y --no-install-recommends \ + ca-certificates \ default-mysql-client \ default-libmysqlclient-dev \ imagemagick ghostscript \ diff --git a/config/docker-files/7.3-Dockerfile b/config/docker-files/7.3-Dockerfile index 905c3a0789ec0c46f1a26f6ba409efe64101106b..91cd7483a82c7813dec0073ed9fc51a1f9ae1703 100644 --- a/config/docker-files/7.3-Dockerfile +++ b/config/docker-files/7.3-Dockerfile @@ -2,6 +2,7 @@ FROM php:7.3-fpm # Install system requirements RUN apt update && apt install -y --no-install-recommends \ + ca-certificates \ default-mysql-client \ default-libmysqlclient-dev \ imagemagick ghostscript \ diff --git a/config/docker-files/7.4-Dockerfile b/config/docker-files/7.4-Dockerfile index be4b2e117592c0dd0040e64a7775dc6e8ab14262..13a1619daae970e9c8a0342199141c68bd714e2d 100644 --- a/config/docker-files/7.4-Dockerfile +++ b/config/docker-files/7.4-Dockerfile @@ -2,6 +2,7 @@ FROM php:7.4-fpm # Install system requirements RUN apt update && apt install -y --no-install-recommends \ + ca-certificates \ default-mysql-client \ default-libmysqlclient-dev \ imagemagick ghostscript \ diff --git a/config/docker-files/8.0-Dockerfile b/config/docker-files/8.0-Dockerfile index d90fa8de0e2b8e46e4de7597c66597f1e50c82a1..689d852add2d9c1b49ec3b7d4c0383fa7bdcea25 100644 --- a/config/docker-files/8.0-Dockerfile +++ b/config/docker-files/8.0-Dockerfile @@ -2,6 +2,7 @@ FROM php:8.0-fpm # Install system requirements RUN apt update && apt install -y --no-install-recommends \ + ca-certificates \ default-mysql-client \ default-libmysqlclient-dev \ imagemagick ghostscript \ diff --git a/config/docker-files/8.1-Dockerfile b/config/docker-files/8.1-Dockerfile index ba576ed76849f113bbd79fbdd3e203310a04bca9..f131e3682105bf2fd4281ed5c5baa54ec405e345 100644 --- a/config/docker-files/8.1-Dockerfile +++ b/config/docker-files/8.1-Dockerfile @@ -2,6 +2,7 @@ FROM php:8.1-fpm # Install system requirements RUN apt update && apt install -y --no-install-recommends \ + ca-certificates \ default-mysql-client \ default-libmysqlclient-dev \ imagemagick ghostscript \ diff --git a/config/docker-files/8.2-Dockerfile b/config/docker-files/8.2-Dockerfile index ed87ae9ee057595fcdc252d4539f22e3fc410dc7..423e8043548260e25abddf8c57f760efd1a90abc 100644 --- a/config/docker-files/8.2-Dockerfile +++ b/config/docker-files/8.2-Dockerfile @@ -2,6 +2,7 @@ FROM php:8.2-fpm # Install system requirements RUN apt update && apt install -y --no-install-recommends \ + ca-certificates \ default-mysql-client \ default-libmysqlclient-dev \ imagemagick ghostscript \ diff --git a/config/docker-files/8.3-Dockerfile b/config/docker-files/8.3-Dockerfile index f430b687fd48a5e971f80cab77b38574867f4108..60e0c0ce519c9f3726229dda555520a02bd63287 100644 --- a/config/docker-files/8.3-Dockerfile +++ b/config/docker-files/8.3-Dockerfile @@ -3,6 +3,7 @@ FROM php:8.3-fpm # Install system requirements RUN apt update \ && apt install -y --no-install-recommends \ + ca-certificates \ default-mysql-client \ default-libmysqlclient-dev \ git \ diff --git a/config/docker-files/8.4-Dockerfile b/config/docker-files/8.4-Dockerfile index a19bbd3c1bf7913cca81ec5a21a67b7b4ad1c40f..43d30d27193f389ded63dd643a5b2dde15ce3abd 100644 --- a/config/docker-files/8.4-Dockerfile +++ b/config/docker-files/8.4-Dockerfile @@ -2,7 +2,9 @@ FROM php:8.4-fpm # Install system requirements RUN apt update \ + && apt upgrade -y \ && apt install -y --no-install-recommends \ + ca-certificates \ default-mysql-client \ default-libmysqlclient-dev \ git \ @@ -30,8 +32,10 @@ RUN apt update \ # Install php extensions && docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \ && docker-php-ext-install -j$(nproc) gd gettext intl mysqli opcache pdo_mysql pdo_pgsql soap xsl zip \ - && pecl install memcached redis xdebug \ - && docker-php-ext-enable memcached redis xdebug \ +# && pecl install memcached redis xdebug \ +# && docker-php-ext-enable memcached redis xdebug \ + && pecl install memcached redis \ + && docker-php-ext-enable memcached redis \ # Cleanup && docker-php-source delete \ diff --git a/lib/Commands/Compile.php b/lib/Commands/Compile.php index ab7701d58a5587ceb67d5e387c049a0b42ff6a35..c203ff68ceeb2af4d4232b232075baeec16cda5e 100644 --- a/lib/Commands/Compile.php +++ b/lib/Commands/Compile.php @@ -168,6 +168,7 @@ final class Compile extends Command 'container_name' => 'db', 'ports' => ['3306:3306'], 'restart' => 'unless-stopped', + 'volumes' => ['db-data:/var/lib/mysql'], 'environment' => [ 'MARIADB_ROOT_PASSWORD' => 'rootpwd', 'MARIADB_USER' => 'studip', @@ -175,7 +176,13 @@ final class Compile extends Command 'MARIADB_MYSQL_LOCALHOST_USER' => 'root', 'MARIADB_AUTO_UPGRADE' => true, ], - 'volumes' => ['db-data:/var/lib/mysql'], + 'healthcheck' => [ + 'test' => ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"], + 'start_period' => '10s', + 'interval' => '10s', + 'timeout' => '10s', + 'retries' => 3, + ] ]); $creator->addVolume('db-data'); @@ -211,7 +218,11 @@ final class Compile extends Command 'environment' => [ 'MYSQL_HOST' => 'db', ], - 'depends_on' => ['db'], + 'depends_on' => [ + 'db' => [ + 'condition' => 'service_healthy', + ] + ], ]); $creator->addServiceVolume( diff --git a/lib/Creators/DockerComposeConfiguration.php b/lib/Creators/DockerComposeConfiguration.php index 9b6438c3b5bd19f6e15301495854561d46841aaa..4beb0c42a5a1c2b7602c53964e61817ccc05fc47 100644 --- a/lib/Creators/DockerComposeConfiguration.php +++ b/lib/Creators/DockerComposeConfiguration.php @@ -63,6 +63,6 @@ final class DockerComposeConfiguration extends ConfigurationCreator public function dump(): string { - return Yaml::dump($this->getConfiguration(), 128); + return Yaml::dump($this->getConfiguration(), 4); } } diff --git a/web/LogParser.php b/web/LogParser.php index 48fad3890bb2a8f6ac6398cc4b644279ef2dff2a..8ac4c4afadba1306ec8feaa371b3d5620b26e973 100644 --- a/web/LogParser.php +++ b/web/LogParser.php @@ -26,6 +26,14 @@ final class LogParser continue; } + $line = str_replace( + [ + '/usr/share/nginx/' + ], + '', + $line + ); + if ($index === -1 || preg_match('/^\[.+]/', $line)) { $index += 1; } diff --git a/web/assets/style.css b/web/assets/style.css index 395d48390e7ffd87db94923205b0d4e2abdd458b..0a34cd0b6a767522e31b0e572357cde42f3c09e0 100644 --- a/web/assets/style.css +++ b/web/assets/style.css @@ -78,11 +78,11 @@ tr:hover td { padding-top: var(--nav-font-size); } #logs-nav { - background-color: inherit; + background-color: black; border-bottom: 1px solid #ccc; padding: 0 0.5em; position: fixed; - top: calc(var(--nav-height) + var(--nav-font-size)); + top: calc(var(--nav-height) + 1em + 1px); left: 0; right: 0; diff --git a/web/index.php b/web/index.php index 82ff48a0c5ef870f9aa70e4320dacf225ceeec54..ccb468544bb7d06155dff9ac61ee1532ef87736c 100644 --- a/web/index.php +++ b/web/index.php @@ -101,7 +101,9 @@ $log = new LogParser(__DIR__ . '/../logs/php/error.log'); <?php if ($log->hasData()): ?> <ul> <?php foreach ($log->entries() as $entry): ?> - <li><?= nl2br(htmlentities($entry)) ?></li> + <li> + <?= nl2br(htmlentities($entry)) ?> + </li> <?php endforeach; ?> </ul> <?php endif; ?>