From 251b07a3b085ba8af7ae3ab4001344d3bad8e54f Mon Sep 17 00:00:00 2001 From: sylvain Date: Fri, 16 May 2025 22:06:11 +0200 Subject: [PATCH] v1 --- dockerfile | 53 +++++++++++++++++++++++++++++++++++++++ src/.htconfig.php | 23 +++++++++++++++++ src/container_apache.conf | 12 +++++++++ src/hubzilla.conf | 12 +++++++++ src/msmtprc | 13 ++++++++++ src/start.sh | 7 ++++++ 6 files changed, 120 insertions(+) create mode 100644 dockerfile create mode 100644 src/.htconfig.php create mode 100644 src/container_apache.conf create mode 100644 src/hubzilla.conf create mode 100644 src/msmtprc create mode 100755 src/start.sh diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..71560ec --- /dev/null +++ b/dockerfile @@ -0,0 +1,53 @@ +FROM debian:12 + +ENV DEBIAN_FRONTEND=noninteractive + +# Installation des dépendances nécessaires +RUN apt-get update && apt-get install -y \ + apache2 \ + 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 \ + git \ + curl \ + unzip \ + nano \ + cron \ + && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Configuration du répertoire de travail +WORKDIR /var/www/html + +# 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 + +# Activation des modules Apache nécessaires +RUN a2enmod rewrite ssl + +# 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 + +# 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 +COPY src/start.sh /start.sh +RUN chmod +x /start.sh + +CMD ["/bin/bash", "/start.sh"] diff --git a/src/.htconfig.php b/src/.htconfig.php new file mode 100644 index 0000000..17d09d2 --- /dev/null +++ b/src/.htconfig.php @@ -0,0 +1,23 @@ + + ServerName yourdomain.com + DocumentRoot /var/www/html + + + AllowOverride All + Require all granted + + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + \ No newline at end of file diff --git a/src/hubzilla.conf b/src/hubzilla.conf new file mode 100644 index 0000000..f22afa5 --- /dev/null +++ b/src/hubzilla.conf @@ -0,0 +1,12 @@ + + ServerName yourdomain.com + DocumentRoot /var/www/html + + + AllowOverride All + Require all granted + + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + diff --git a/src/msmtprc b/src/msmtprc new file mode 100644 index 0000000..8fa31ca --- /dev/null +++ b/src/msmtprc @@ -0,0 +1,13 @@ +# msmtprc global config +defaults +auth on +tls on +tls_trust_file /etc/ssl/certs/ca-certificates.crt +logfile /var/log/msmtp.log + +account default +host {{SMTP_SERVER}} +port {{SMTP_PORT}} +from {{SMTP_EMAIL}} +user {{SMTP_USER}} +password {{SMTP_PASS}} diff --git a/src/start.sh b/src/start.sh new file mode 100755 index 0000000..98cd5ec --- /dev/null +++ b/src/start.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Démarrage du service Apache +service apache2 start + +# Attente indéfinie pour maintenir le conteneur en cours d'exécution +tail -f /dev/null \ No newline at end of file