mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-11 17:29:48 +02:00
Automate application deployment using a simplified Portainer script
Adds a docker-compose file and deploy script for automated Portainer deployment. Replit-Commit-Author: Agent Replit-Commit-Session-Id: dec54137-d5a2-4406-8ad4-5f2f9fb110bf Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/6766644a-420b-4242-91df-d40e1146cc68.jpg
This commit is contained in:
1 parent
32042eb668
commit
1b0ecc7b39
3 files changed
+135
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script de déploiement simplifié pour Portainer
|
||||
# Gère tout automatiquement sans configuration manuelle
|
||||
|
||||
echo "🚀 Déploiement RegisFlow pour Portainer (Automatique)"
|
||||
echo "===================================================="
|
||||
|
||||
# Créer un répertoire de déploiement temporaire
|
||||
DEPLOY_DIR="/tmp/regisflow-deploy"
|
||||
CURRENT_DIR=$(pwd)
|
||||
|
||||
echo "📁 Préparation du déploiement..."
|
||||
|
||||
# Nettoyer le répertoire de déploiement s'il existe
|
||||
rm -rf "$DEPLOY_DIR"
|
||||
mkdir -p "$DEPLOY_DIR"
|
||||
|
||||
# Copier tous les fichiers nécessaires
|
||||
echo "📋 Copie des fichiers..."
|
||||
cp -r . "$DEPLOY_DIR/"
|
||||
cd "$DEPLOY_DIR"
|
||||
|
||||
# Utiliser le Docker Compose spécifique à Portainer
|
||||
mv docker-compose-portainer.yml docker-compose.yml
|
||||
|
||||
echo "🔧 Construction et démarrage..."
|
||||
|
||||
# Arrêter les conteneurs existants
|
||||
docker-compose down 2>/dev/null || true
|
||||
|
||||
# Construire et démarrer
|
||||
docker-compose up -d --build
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✅ Déploiement réussi!"
|
||||
echo ""
|
||||
echo "📊 État des conteneurs:"
|
||||
docker-compose ps
|
||||
echo ""
|
||||
echo "🔗 Application accessible sur: http://localhost:5000"
|
||||
echo "🔐 Connexion par défaut: admin/admin123"
|
||||
echo "🗄️ PostgreSQL accessible sur le port: 5433"
|
||||
echo ""
|
||||
echo "📋 Commandes utiles:"
|
||||
echo " - Voir les logs: docker-compose logs -f"
|
||||
echo " - Arrêter: docker-compose down"
|
||||
echo " - Redémarrer: docker-compose restart"
|
||||
echo ""
|
||||
echo "📁 Fichiers de déploiement dans: $DEPLOY_DIR"
|
||||
else
|
||||
echo "❌ Échec du déploiement"
|
||||
echo "📋 Vérifiez les logs avec: docker-compose logs"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Retourner au répertoire original
|
||||
cd "$CURRENT_DIR"
|
||||
@@ -0,0 +1,77 @@
|
||||
version: '3.8'
|
||||
|
||||
# Docker Compose pour Portainer - Construction automatique
|
||||
# Ce fichier gère tout automatiquement sans configuration supplémentaire
|
||||
services:
|
||||
# Base de données PostgreSQL
|
||||
regisflow-db:
|
||||
image: postgres:15-alpine
|
||||
container_name: regisflow-db
|
||||
environment:
|
||||
POSTGRES_DB: regisflow
|
||||
POSTGRES_USER: regisflow
|
||||
POSTGRES_PASSWORD: RegisFlow2024!PostgreSQL
|
||||
volumes:
|
||||
- regisflow_postgres_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5433:5432"
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U regisflow -d regisflow"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 30s
|
||||
networks:
|
||||
- regisflow_network
|
||||
|
||||
# Application RegisFlow - Construction depuis le répertoire courant
|
||||
regisflow-app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
target: production
|
||||
image: regisflow-app:latest
|
||||
container_name: regisflow-app
|
||||
depends_on:
|
||||
regisflow-db:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
PORT: 5000
|
||||
DATABASE_URL: postgresql://regisflow:RegisFlow2024!PostgreSQL@regisflow-db:5432/regisflow
|
||||
SESSION_SECRET: RegisFlow2024SessionSecretKey1234567890ABCDEF
|
||||
TZ: Europe/Paris
|
||||
SECURE_COOKIES: false
|
||||
DATA_RETENTION_MONTHS: 19
|
||||
BACKUP_RETENTION_DAYS: 90
|
||||
MAX_BACKUP_COUNT: 20
|
||||
volumes:
|
||||
- regisflow_backup_data:/app/backups
|
||||
- regisflow_logs_data:/app/logs
|
||||
ports:
|
||||
- "5000:5000"
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:5000/health || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 15s
|
||||
retries: 3
|
||||
start_period: 90s
|
||||
networks:
|
||||
- regisflow_network
|
||||
|
||||
# Volumes avec noms uniques pour éviter les conflits
|
||||
volumes:
|
||||
regisflow_postgres_data:
|
||||
driver: local
|
||||
regisflow_backup_data:
|
||||
driver: local
|
||||
regisflow_logs_data:
|
||||
driver: local
|
||||
|
||||
# Réseau dédié avec nom unique
|
||||
networks:
|
||||
regisflow_network:
|
||||
driver: bridge
|
||||
name: regisflow_net
|
||||
Reference in new issue
Block a user