diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..481c469 Binary files /dev/null and b/.DS_Store differ diff --git a/Dockerfile b/Dockerfile index af802de..674c16c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,30 @@ -# Dockerfile FROM php:8.3-apache -# Apache config -COPY conf/vhost.conf /etc/apache2/sites-available/000-default.conf -COPY conf/apache.conf /etc/apache2/conf-available/z-ambient.conf -COPY errors /errors -RUN a2enconf z-ambient +EXPOSE 80 +WORKDIR /app -# Php config +HEALTHCHECK --interval=1m --timeout=3s --start-period=5s --start-interval=1s --retries=3 \ + CMD curl -f http://localhost/_health || exit 1 + +# git, unzip & zip are for composer RUN apt-get update -qq && \ apt-get install -qy \ git \ gnupg \ unzip \ - zip \ - nano -RUN docker-php-ext-install -j$(nproc) opcache mbstring -COPY conf/php.ini /usr/local/etc/php/conf.d/app.ini + zip && \ + apt-get clean && rm -rf /var/lib/apt/lists/* /var/log/* + +# PHP Extensions +RUN docker-php-ext-install -j$(nproc) opcache mbstring +COPY --link conf/php.ini /usr/local/etc/php/conf.d/app.ini + +# Apache +COPY --link errors /errors +COPY --link health.php /health/index.php +COPY --link conf/vhost.conf /etc/apache2/sites-available/000-default.conf +COPY --link conf/apache.conf /etc/apache2/conf-available/z-ambient.conf +COPY --link /src /app + +RUN a2enmod rewrite remoteip && \ + a2enconf z-ambient diff --git a/errors/403.html b/errors/403.html new file mode 100644 index 0000000..97890d1 --- /dev/null +++ b/errors/403.html @@ -0,0 +1,20 @@ + + + + + + + Erreur 403 (Interdit) + + + + +
+
+

403

+

Accès interdit.

+

L'accès à cette page requiert une autorisation.

+ Retour à la page d'accueil +
+ + diff --git a/errors/404.html b/errors/404.html new file mode 100644 index 0000000..f0b6399 --- /dev/null +++ b/errors/404.html @@ -0,0 +1,20 @@ + + + + + + + Erreur 404 (Introuvable) + + + + +
+
+

404

+

Oops! Vous êtes perdu.

+

La page que vous demandez est introuvable. Elle a peut-être été supprimée ou déplacée.

+ Retour à la page d'accueil +
+ + diff --git a/errors/500.html b/errors/500.html new file mode 100644 index 0000000..b34c2d7 --- /dev/null +++ b/errors/500.html @@ -0,0 +1,20 @@ + + + + + + + Erreur 500 (Inaccessible) + + + + +
+
+

500

+

Huston, on a un problème !

+

La page que vous demandez est temporairement inaccessible.

+ Retour à la page d'accueil +
+ + diff --git a/errors/css/style.css b/errors/css/style.css new file mode 100644 index 0000000..6be89a5 --- /dev/null +++ b/errors/css/style.css @@ -0,0 +1,102 @@ +html { + box-sizing: border-box; + font-size: 16px; +} + +*, *:before, *:after { + box-sizing: inherit; +} + +body, h1, h2, h3, h4, h5, h6, p, ol, ul { + margin: 0; + padding: 0; + font-weight: normal; +} + +ol, ul { + list-style: none; +} + +html, body { + height: 100%; +} + +body { + font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +#error-box { + position: relative; + max-width: 560px; + width: 100%; + padding-left: 160px; + line-height: 1.1; +} + +#error-box #error-image { + position: absolute; + left: 0; + top: 0; + display: inline-block; + width: 140px; + height: 140px; + background-image: url('/_errors/img/emoji.png'); + background-size: cover; +} + +#error-box #error-image:before { + content: ''; + position: absolute; + width: 100%; + height: 100%; + transform: scale(2.4); + border-radius: 50%; + background-color: #f2f5f8; + z-index: -1; +} + +#error-box h1 { + font-size: 65px; + font-weight: 700; + margin-top: 0; + margin-bottom: 10px; + color: #151723; + text-transform: uppercase; +} + +#error-box h2 { + font-size: 21px; + font-weight: 400; + margin: 0 0 1rem 0; + text-transform: uppercase; + color: #151723; +} + +#error-box p { + color: #999fa5; + font-weight: 400; + margin-bottom: 1rem; +} + +#error-box a { + font-weight: 500; + text-decoration: none; + color: #388dbc; +} + +@media only screen and (max-width: 767px) { + #error-box #error-image { + width: 110px; + height: 110px; + } + + #error-box { + padding-left: 15px; + padding-right: 15px; + padding-top: 110px; + } +} diff --git a/errors/img/emoji.png b/errors/img/emoji.png new file mode 100644 index 0000000..7cd4942 Binary files /dev/null and b/errors/img/emoji.png differ diff --git a/health.php b/health.php new file mode 100644 index 0000000..d6bd4dc --- /dev/null +++ b/health.php @@ -0,0 +1,3 @@ +