mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-15 19:28:04 +02:00
Enable application deployment by building directly from source code
Updates docker-compose and portainer-stack files to build the regisflow image and adds PORTAINER_SOLUTION.md, and portainer-build-stack.yml. 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
61be21d06c
commit
32042eb668
5 files changed
+236
-3
No files matched your search
@@ -0,0 +1,153 @@
|
||||
# Solution Portainer pour RegisFlow
|
||||
|
||||
## Problème identifié
|
||||
Portainer ne peut pas télécharger l'image `regisflow` car elle n'existe pas sur Docker Hub. Il faut construire l'image depuis le code source.
|
||||
|
||||
## Solution 1: Stack avec build automatique (RECOMMANDÉE)
|
||||
|
||||
### Étapes dans Portainer:
|
||||
|
||||
1. **Allez dans "Stacks"**
|
||||
2. **Cliquez sur "Add stack"**
|
||||
3. **Nom de la stack**: `regisflow`
|
||||
4. **Méthode de build**: Repository
|
||||
5. **Repository URL**: Collez l'URL de votre dépôt Git ou utilisez "Upload"
|
||||
6. **Compose file**: Copiez le contenu de `portainer-build-stack.yml`
|
||||
7. **Cliquez sur "Deploy the stack"**
|
||||
|
||||
### Contenu à copier dans Portainer:
|
||||
|
||||
```yaml
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
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
|
||||
|
||||
regisflow:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
target: production
|
||||
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
|
||||
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:
|
||||
postgres_data:
|
||||
backup_data:
|
||||
logs_data:
|
||||
```
|
||||
|
||||
## Solution 2: Construction manuelle puis image
|
||||
|
||||
Si la solution 1 ne fonctionne pas:
|
||||
|
||||
### Étape A: Sur votre serveur
|
||||
```bash
|
||||
# Téléchargez les fichiers RegisFlow sur votre serveur
|
||||
# Puis construisez l'image:
|
||||
docker build -t regisflow:latest .
|
||||
|
||||
# Vérifiez que l'image existe:
|
||||
docker images | grep regisflow
|
||||
```
|
||||
|
||||
### Étape B: Dans Portainer
|
||||
Utilisez ensuite le fichier `portainer-stack.yml` original avec `image: regisflow:latest`
|
||||
|
||||
## Solution 3: Docker Hub personnel (avancée)
|
||||
|
||||
Si vous avez un compte Docker Hub:
|
||||
|
||||
```bash
|
||||
# Taguez l'image avec votre nom d'utilisateur
|
||||
docker tag regisflow:latest votre-username/regisflow:latest
|
||||
|
||||
# Poussez vers Docker Hub
|
||||
docker push votre-username/regisflow:latest
|
||||
```
|
||||
|
||||
Puis utilisez `votre-username/regisflow:latest` dans Portainer.
|
||||
|
||||
## Vérification du déploiement
|
||||
|
||||
### Dans Portainer:
|
||||
1. Vérifiez que la stack est "Running"
|
||||
2. Consultez les logs des conteneurs
|
||||
3. Vérifiez les health checks
|
||||
|
||||
### Accès à l'application:
|
||||
- URL: `http://votre-serveur:5000`
|
||||
- Login: `admin`
|
||||
- Mot de passe: `admin123`
|
||||
|
||||
### Tests de connectivité:
|
||||
```bash
|
||||
# Test de santé de l'application
|
||||
curl http://localhost:5000/health
|
||||
|
||||
# Vérification PostgreSQL
|
||||
docker exec regisflow-db pg_isready -U regisflow -d regisflow
|
||||
```
|
||||
|
||||
## Résolution des problèmes courants
|
||||
|
||||
### Stack en échec de build:
|
||||
1. Vérifiez que tous les fichiers sont présents
|
||||
2. Consultez les logs de build dans Portainer
|
||||
3. Vérifiez les droits d'accès au Dockerfile
|
||||
|
||||
### Conteneur qui ne démarre pas:
|
||||
1. Vérifiez les logs du conteneur
|
||||
2. Vérifiez les variables d'environnement
|
||||
3. Attendez que PostgreSQL soit prêt (health check)
|
||||
|
||||
### Application inaccessible:
|
||||
1. Vérifiez que le port 5000 est ouvert
|
||||
2. Vérifiez les logs de l'application
|
||||
3. Testez le health check: `/health`
|
||||
|
||||
## Points importants
|
||||
|
||||
✅ **Utilisez la Solution 1 avec build automatique**
|
||||
✅ **Tous les fichiers sources doivent être disponibles pour Portainer**
|
||||
✅ **PostgreSQL démarre en premier (health check)**
|
||||
✅ **Volumes persistants pour les données**
|
||||
✅ **Réseau dédié pour la communication inter-conteneurs**
|
||||
✅ **Health checks configurés pour surveillance automatique**
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
+3
-1
@@ -25,7 +25,9 @@ services:
|
||||
|
||||
# Application RegisFlow
|
||||
regisflow:
|
||||
image: regisflow:latest
|
||||
build:
|
||||
context: .
|
||||
target: production
|
||||
container_name: regisflow-app
|
||||
depends_on:
|
||||
regisflow-db:
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
version: '3.8'
|
||||
|
||||
# Configuration Stack Portainer pour RegisFlow avec build automatique
|
||||
# Cette version construit l'image automatiquement depuis le code source
|
||||
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
|
||||
networks:
|
||||
- regisflow-net
|
||||
|
||||
# Application RegisFlow - Construction automatique
|
||||
regisflow:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
target: production
|
||||
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
|
||||
networks:
|
||||
- regisflow-net
|
||||
|
||||
# Volumes persistants
|
||||
volumes:
|
||||
postgres_data:
|
||||
driver: local
|
||||
backup_data:
|
||||
driver: local
|
||||
logs_data:
|
||||
driver: local
|
||||
|
||||
# Réseau dédié
|
||||
networks:
|
||||
regisflow-net:
|
||||
driver: bridge
|
||||
+5
-2
@@ -23,9 +23,12 @@ services:
|
||||
retries: 5
|
||||
start_period: 30s
|
||||
|
||||
# Application RegisFlow - Image construite localement
|
||||
# Application RegisFlow - Construction depuis le code source
|
||||
regisflow:
|
||||
image: regisflow:latest
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
target: production
|
||||
container_name: regisflow-app
|
||||
depends_on:
|
||||
regisflow-db:
|
||||
|
||||
Reference in new issue
Block a user