From 6f6cc8fc63c205999d4599abf4a1f8b7cf657194 Mon Sep 17 00:00:00 2001 From: sylvain Date: Tue, 20 May 2025 19:30:00 +0200 Subject: [PATCH] hubzilla-nginx-v0.2 --- src/container_apache.conf | 12 ------------ src/hubzilla-nginx.conf | 20 ++++++++++++++++++++ src/hubzilla.conf | 12 ------------ src/start.sh | 20 ++++++++++++++++---- 4 files changed, 36 insertions(+), 28 deletions(-) delete mode 100644 src/container_apache.conf create mode 100644 src/hubzilla-nginx.conf delete mode 100644 src/hubzilla.conf diff --git a/src/container_apache.conf b/src/container_apache.conf deleted file mode 100644 index a3e3ed3..0000000 --- a/src/container_apache.conf +++ /dev/null @@ -1,12 +0,0 @@ - - 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-nginx.conf b/src/hubzilla-nginx.conf new file mode 100644 index 0000000..5a73383 --- /dev/null +++ b/src/hubzilla-nginx.conf @@ -0,0 +1,20 @@ +server { + listen 80; + server_name localhost; + + root /hubzilla-src; + index index.php index.html; + + location / { + try_files $uri $uri/ /index.php?$args; + } + + location ~ \.php$ { + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/run/php/php8.2-fpm.sock; + } + + location ~ /\.ht { + deny all; + } +} diff --git a/src/hubzilla.conf b/src/hubzilla.conf deleted file mode 100644 index f22afa5..0000000 --- a/src/hubzilla.conf +++ /dev/null @@ -1,12 +0,0 @@ - - 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/start.sh b/src/start.sh index 98cd5ec..c5e98d9 100755 --- a/src/start.sh +++ b/src/start.sh @@ -1,7 +1,19 @@ #!/bin/bash -# Démarrage du service Apache -service apache2 start +# Copie automatique si le volume bindé est vide +if [ ! "$(ls -A /var/www/html)" ]; then + echo "📁 Volume vide, initialisation des fichiers Hubzilla..." + cp -a /hubzilla-src/. /var/www/html/ + chown -R www-data:www-data /var/www/html/ +else + echo "📁 Volume déjà initialisé." +fi -# Attente indéfinie pour maintenir le conteneur en cours d'exécution -tail -f /dev/null \ No newline at end of file +# Démarrage des services PHP-FPM et Nginx +echo "🚀 Démarrage des services PHP-FPM et Nginx..." +service php8.2-fpm start +service nginx start + +# Maintien du conteneur actif +echo "📡 En attente (container actif)..." +tail -f /dev/null