This commit is contained in:
2025-05-16 22:06:11 +02:00
parent 2ff550f024
commit 251b07a3b0
6 changed files with 120 additions and 0 deletions

53
dockerfile Normal file
View File

@@ -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"]

23
src/.htconfig.php Normal file
View File

@@ -0,0 +1,23 @@
<?php
define('NAMESPACE_SEPARATOR', '\\');
define('Z_ROOT', dirname(__FILE__));
define('Z_PATH', dirname(__FILE__));
define('Z_CONFIG', dirname(__FILE__));
define('Z_DATA', 'store');
// Base de données
$db_host = 'db';
$db_port = 3306;
$db_user = 'hubzilla';
$db_pass = 'hubzilla_pass';
$db_data = 'hubzilla';
$default_timezone = 'Europe/Paris';
$hostname = '{{DOMAIN}}';
$site_location = 'https://{{DOMAIN}}/';
$admin_email = '{{ADMIN_EMAIL}}';
$site_id = '{{LOCATION_HASH}}';
define('MYSQL_AVAILABLE', true);

12
src/container_apache.conf Normal file
View File

@@ -0,0 +1,12 @@
<VirtualHost *:80>
ServerName yourdomain.com
DocumentRoot /var/www/html
<Directory /var/www/html>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

12
src/hubzilla.conf Normal file
View File

@@ -0,0 +1,12 @@
<VirtualHost *:80>
ServerName yourdomain.com
DocumentRoot /var/www/html
<Directory /var/www/html>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

13
src/msmtprc Normal file
View File

@@ -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}}

7
src/start.sh Executable file
View File

@@ -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