mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-11 17:29:48 +02:00
Enable easy deployment using Portainer and resolve image pull errors
Adds Portainer deployment configuration, scripts, and documentation, and fixes local image building. 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/c7544f27-893f-4348-971a-1d048c9a4d80.jpg
This commit is contained in:
1 parent
d8e5af6c77
commit
61be21d06c
4 files changed
+225
No files matched your search
@@ -0,0 +1,104 @@
|
||||
# Guide de déploiement Portainer pour RegisFlow
|
||||
|
||||
## Problème résolu
|
||||
L'erreur `regisflow-regisflow:latest` vient du fait que Portainer cherche une image sur Docker Hub qui n'existe pas.
|
||||
|
||||
## Solution complète
|
||||
|
||||
### Étape 1: Construire l'image sur votre serveur
|
||||
|
||||
```bash
|
||||
# Connectez-vous à votre serveur et allez dans le dossier RegisFlow
|
||||
cd /chemin/vers/regisflow
|
||||
|
||||
# Construisez l'image Docker
|
||||
docker build -t regisflow:latest .
|
||||
|
||||
# Vérifiez que l'image est créée
|
||||
docker images | grep regisflow
|
||||
```
|
||||
|
||||
### Étape 2: Créer la Stack dans Portainer
|
||||
|
||||
1. **Ouvrez Portainer** dans votre navigateur
|
||||
2. **Allez dans "Stacks"**
|
||||
3. **Cliquez sur "Add stack"**
|
||||
4. **Donnez un nom** : `regisflow`
|
||||
5. **Copiez le contenu** du fichier `portainer-stack.yml`
|
||||
6. **Cliquez sur "Deploy the stack"**
|
||||
|
||||
### Étape 3: Configuration alternative (Container unique)
|
||||
|
||||
Si vous préférez créer un conteneur unique :
|
||||
|
||||
1. **Allez dans "Containers"**
|
||||
2. **Cliquez sur "Add container"**
|
||||
3. **Nom** : `regisflow-app`
|
||||
4. **Image** : `regisflow:latest`
|
||||
5. **Port mapping** : `5000:5000`
|
||||
6. **Variables d'environnement** :
|
||||
```
|
||||
NODE_ENV=production
|
||||
PORT=5000
|
||||
DATABASE_URL=postgresql://regisflow:RegisFlow2024!PostgreSQL@regisflow-db:5432/regisflow
|
||||
SESSION_SECRET=RegisFlow2024SessionSecretKey1234567890ABCDEF
|
||||
```
|
||||
|
||||
## Script automatique
|
||||
|
||||
Pour simplifier le processus :
|
||||
|
||||
```bash
|
||||
# Exécutez le script de déploiement
|
||||
./deploy-portainer.sh
|
||||
```
|
||||
|
||||
## Vérification du déploiement
|
||||
|
||||
### Vérifier les conteneurs
|
||||
```bash
|
||||
docker ps | grep regisflow
|
||||
```
|
||||
|
||||
### Vérifier les logs
|
||||
```bash
|
||||
docker logs regisflow-app
|
||||
```
|
||||
|
||||
### Tester l'application
|
||||
```bash
|
||||
curl http://localhost:5000/health
|
||||
```
|
||||
|
||||
## Résolution des problèmes
|
||||
|
||||
### Si l'image n'est pas trouvée
|
||||
1. Vérifiez que vous êtes sur le bon serveur
|
||||
2. Reconstruisez l'image : `docker build -t regisflow:latest .`
|
||||
3. Vérifiez avec : `docker images | grep regisflow`
|
||||
|
||||
### Si Portainer ne trouve pas l'image
|
||||
1. L'image doit être construite sur le même serveur que Portainer
|
||||
2. Utilisez exactement le nom : `regisflow:latest`
|
||||
3. Pas de préfixe `docker.io/library/`
|
||||
|
||||
### Si la base de données ne se connecte pas
|
||||
1. Vérifiez que PostgreSQL est démarré
|
||||
2. Vérifiez la variable `DATABASE_URL`
|
||||
3. Attendez que le health check passe (30-60 secondes)
|
||||
|
||||
## Points importants
|
||||
|
||||
- ✅ L'image doit être construite localement
|
||||
- ✅ Utilisez `regisflow:latest` (pas `regisflow-regisflow:latest`)
|
||||
- ✅ PostgreSQL inclus dans la stack
|
||||
- ✅ Volumes persistants pour les données
|
||||
- ✅ Health checks configurés
|
||||
- ✅ Ports : 5000 (app) et 5433 (PostgreSQL)
|
||||
|
||||
## Accès à l'application
|
||||
|
||||
Une fois déployé :
|
||||
- **URL** : `http://votre-serveur:5000`
|
||||
- **Connexion** : `admin` / `admin123`
|
||||
- **Changez le mot de passe** après la première connexion
|
||||
Executable
+47
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script de déploiement pour Portainer RegisFlow
|
||||
# Ce script prépare et déploie RegisFlow via Portainer
|
||||
|
||||
echo "🚀 Déploiement RegisFlow pour Portainer"
|
||||
echo "======================================"
|
||||
|
||||
# Étape 1: Construire l'image Docker
|
||||
echo "🔧 Étape 1: Construction de l'image Docker..."
|
||||
docker build -t regisflow:latest .
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✅ Image construite avec succès"
|
||||
else
|
||||
echo "❌ Échec de la construction de l'image"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Étape 2: Vérifier que l'image existe
|
||||
echo "🔍 Étape 2: Vérification de l'image..."
|
||||
docker images | grep regisflow
|
||||
|
||||
# Étape 3: Arrêter les conteneurs existants si ils existent
|
||||
echo "🛑 Étape 3: Nettoyage des conteneurs existants..."
|
||||
docker stop regisflow-app regisflow-db 2>/dev/null || true
|
||||
docker rm regisflow-app regisflow-db 2>/dev/null || true
|
||||
|
||||
# Étape 4: Informations pour Portainer
|
||||
echo ""
|
||||
echo "🐳 Instructions pour Portainer:"
|
||||
echo "==============================="
|
||||
echo "1. Dans Portainer, allez dans 'Stacks'"
|
||||
echo "2. Cliquez sur 'Add stack'"
|
||||
echo "3. Donnez un nom: 'regisflow'"
|
||||
echo "4. Copiez le contenu du fichier 'portainer-stack.yml'"
|
||||
echo "5. Cliquez sur 'Deploy the stack'"
|
||||
echo ""
|
||||
echo "📝 Nom de l'image à utiliser: regisflow:latest"
|
||||
echo "🔗 URL d'accès: http://votre-serveur:5000"
|
||||
echo "🔐 Connexion par défaut: admin/admin123"
|
||||
echo ""
|
||||
echo "📋 Ports exposés:"
|
||||
echo " - Application: 5000"
|
||||
echo " - PostgreSQL: 5433"
|
||||
echo ""
|
||||
echo "✅ Prêt pour le déploiement Portainer!"
|
||||
@@ -0,0 +1,65 @@
|
||||
version: '3.8'
|
||||
|
||||
# Configuration Stack Portainer pour RegisFlow
|
||||
# À utiliser directement dans Portainer comme Stack
|
||||
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:
|
||||
- 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
|
||||
|
||||
# Application RegisFlow - Image construite localement
|
||||
regisflow:
|
||||
image: regisflow: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:
|
||||
- backup_data:/app/backups
|
||||
- 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
|
||||
|
||||
# Volumes persistants
|
||||
volumes:
|
||||
postgres_data:
|
||||
backup_data:
|
||||
logs_data:
|
||||
|
||||
# Utilisation du réseau par défaut
|
||||
networks:
|
||||
default:
|
||||
name: regisflow-network
|
||||
@@ -286,6 +286,15 @@ Preferred communication style: Simple, everyday language.
|
||||
- ✅ Database tables now created automatically on first container startup
|
||||
- ✅ Complete Docker deployment package ready with all fixes applied
|
||||
|
||||
### Portainer Deployment Fix (January 10, 2025)
|
||||
- ✅ Resolved Docker image pull error "regisflow-regisflow:latest" in Portainer
|
||||
- ✅ Created local image building solution with "regisflow:latest" tag
|
||||
- ✅ Generated Portainer-specific stack configuration (portainer-stack.yml)
|
||||
- ✅ Built automated deployment script (deploy-portainer.sh) for server setup
|
||||
- ✅ Created comprehensive Portainer deployment guide (PORTAINER_GUIDE.md)
|
||||
- ✅ Fixed image reference in docker-compose.yml to use local image
|
||||
- ✅ Configured proper networking and volume management for Portainer stacks
|
||||
|
||||
### Production Deployment System (January 9, 2025)
|
||||
- ✅ Multi-stage Dockerfile optimized for production with security hardening
|
||||
- ✅ Production-specific Docker Compose configuration with resource limits
|
||||
|
||||
Reference in new issue
Block a user