dev_env
This commit is contained in:
45
deploy-dev.sh
Executable file
45
deploy-dev.sh
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
# Déploiement dev.jool-international.com
|
||||
# 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 ─────────────────────────────────
|
||||
if [ ! -f .env.dev ]; then
|
||||
echo "❌ .env.dev introuvable."
|
||||
echo " Copie .env.dev.example en .env.dev et remplis les valeurs."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ .env.dev trouvé"
|
||||
|
||||
# ── 2. Démarrer avec nginx HTTP only ─────────────────────
|
||||
echo "🚀 Démarrage des conteneurs (HTTP only)..."
|
||||
$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"
|
||||
Reference in New Issue
Block a user