diff --git a/dockerfile b/dockerfile index 71560ec..edb4d92 100644 --- a/dockerfile +++ b/dockerfile @@ -2,51 +2,54 @@ FROM debian:12 ENV DEBIAN_FRONTEND=noninteractive -# Installation des dépendances nécessaires +# Dépôt PHP 8.2 +RUN apt-get update && \ + apt-get install -y lsb-release gnupg2 ca-certificates curl && \ + echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list && \ + curl -fsSL https://packages.sury.org/php/apt.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/php.gpg + +# Installation paquets RUN apt-get update && apt-get install -y \ - apache2 \ + nginx \ mariadb-client \ - php \ - php-cli \ - php-mysql \ - php-curl \ - php-gd \ - php-json \ - php-xml \ - php-zip \ - php-mbstring \ - php-bcmath \ - php-gmp \ - php-intl \ + php8.2-fpm \ + php8.2-cli \ + php8.2-mysql \ + php8.2-curl \ + php8.2-gd \ + php8.2-xml \ + php8.2-zip \ + php8.2-mbstring \ + php8.2-bcmath \ + php8.2-gmp \ + php8.2-intl \ git \ - curl \ unzip \ nano \ cron \ && apt-get clean && rm -rf /var/lib/apt/lists/* -# Configuration du répertoire de travail -WORKDIR /var/www/html +# Répertoire de travail +WORKDIR /var/www -# Clonage du dépôt Hubzilla -RUN rm -r /var/www/html/ -RUN git clone https://framagit.org/hubzilla/core.git . && \ - mkdir -p store/[data]/smarty3 && \ - chown -R www-data:www-data /var/www/html +# Cloner dans dossier temporaire +RUN git clone https://framagit.org/hubzilla/core.git /hubzilla-src && \ + mkdir -p /hubzilla-src/store/[data]/smarty3 && \ + chown -R www-data:www-data /hubzilla-src && \ + chmod -R 750 /hubzilla-src -# Activation des modules Apache nécessaires -RUN a2enmod rewrite ssl +# Config PHP-FPM +RUN PHPINI=/etc/php/8.2/fpm/php.ini && \ + [ -f "$PHPINI" ] && echo "upload_max_filesize = 20M" >> "$PHPINI" && \ + echo "post_max_size = 20M" >> "$PHPINI" && \ + echo "register_argc_argv = On" >> "$PHPINI" -# Configuration de PHP -RUN echo "upload_max_filesize = 20M" >> /etc/php/8.2/apache2/php.ini && \ - echo "post_max_size = 20M" >> /etc/php/8.2/apache2/php.ini && \ - echo "register_argc_argv = On" >> /etc/php/8.2/apache2/php.ini +# Config Nginx +COPY src/hubzilla-nginx.conf /etc/nginx/sites-available/hubzilla +RUN ln -s /etc/nginx/sites-available/hubzilla /etc/nginx/sites-enabled/hubzilla && \ + rm -f /etc/nginx/sites-enabled/default -# Configuration du site Apache -COPY src/hubzilla.conf /etc/apache2/sites-available/hubzilla.conf -RUN a2dissite 000-default.conf && a2ensite hubzilla.conf - -# Copie du script de démarrage +# Script de démarrage COPY src/start.sh /start.sh RUN chmod +x /start.sh