Skip to content
Snippets Groups Projects
Commit 62d8aa77 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

wip

parent f63e403a
No related branches found
No related tags found
No related merge requests found
......@@ -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 \
......
......@@ -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 \
......
......@@ -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 \
......
......@@ -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 \
......
......@@ -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 \
......
......@@ -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 \
......
......@@ -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 \
......
......@@ -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 \
......
......@@ -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(
......
......@@ -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);
}
}
......@@ -26,6 +26,14 @@ final class LogParser
continue;
}
$line = str_replace(
[
'/usr/share/nginx/'
],
'',
$line
);
if ($index === -1 || preg_match('/^\[.+]/', $line)) {
$index += 1;
}
......
......@@ -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;
......
......@@ -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; ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment