serveur caddy
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
#!/bin/bash
|
||||
# Déploiement dev.jool-international.com
|
||||
# Déploiement dev.jool-international.com (Caddy)
|
||||
# Usage : bash deploy-dev.sh
|
||||
set -e
|
||||
|
||||
DOMAIN="dev.jool-international.com"
|
||||
EMAIL="info@jool-int.com"
|
||||
COMPOSE="docker compose -f docker-compose.dev.yml"
|
||||
|
||||
# ── 1. Vérifier .env.dev ─────────────────────────────────
|
||||
@@ -16,30 +14,13 @@ fi
|
||||
|
||||
echo "✅ .env.dev trouvé"
|
||||
|
||||
# ── 2. Démarrer avec nginx HTTP only ─────────────────────
|
||||
echo "🚀 Démarrage des conteneurs (HTTP only)..."
|
||||
# ── 2. Build et démarrage ─────────────────────────────────
|
||||
echo "🚀 Build et démarrage des conteneurs..."
|
||||
$COMPOSE up -d --build
|
||||
|
||||
# Attendre que nginx soit prêt
|
||||
sleep 5
|
||||
|
||||
# ── 3. Obtenir le certificat SSL ─────────────────────────
|
||||
echo "🔒 Obtention du certificat SSL pour $DOMAIN..."
|
||||
$COMPOSE run --rm certbot certonly \
|
||||
--webroot \
|
||||
--webroot-path=/var/www/certbot \
|
||||
-d "$DOMAIN" \
|
||||
--email "$EMAIL" \
|
||||
--agree-tos \
|
||||
--no-eff-email
|
||||
|
||||
# ── 4. Passer à la config HTTPS ──────────────────────────
|
||||
echo "🔄 Activation de la config HTTPS..."
|
||||
sed -i 's|nginx.dev-init.conf|nginx.dev.conf|g' docker-compose.dev.yml
|
||||
|
||||
# Redémarrer nginx avec la config HTTPS
|
||||
$COMPOSE up -d nginx
|
||||
|
||||
echo ""
|
||||
echo "✅ Déploiement terminé !"
|
||||
echo " Site disponible sur https://$DOMAIN"
|
||||
echo " Caddy obtient le certificat SSL automatiquement."
|
||||
echo " Site disponible sur https://dev.jool-international.com"
|
||||
echo ""
|
||||
echo " Logs : docker compose -f docker-compose.dev.yml logs -f"
|
||||
|
||||
Reference in New Issue
Block a user