mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-12 01:37:40 +02:00
Merge pull request #176 from R0m1k3/1.1
Update Dockerfile to fix entrypoint error and improve startup
This commit is contained in:
2 files changed
+40
-6
No files matched your search
+3
-6
@@ -106,11 +106,8 @@ USER nextjs
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/api/health || exit 1
|
||||
|
||||
# Copy and set entrypoint script
|
||||
COPY --chown=nextjs:nodejs scripts/docker-entrypoint.sh ./
|
||||
RUN chmod +x /app/scripts/auto-migrate-production.sh && \
|
||||
chmod +x /app/docker-entrypoint.sh
|
||||
# Make migration script executable
|
||||
RUN chmod +x /app/scripts/auto-migrate-production.sh
|
||||
|
||||
# Start the application with migration
|
||||
ENTRYPOINT ["/app/docker-entrypoint.sh"]
|
||||
# Start the application normally (migration will be manual or via init script)
|
||||
CMD ["node", "dist/index.js"]
|
||||
@@ -0,0 +1,37 @@
|
||||
# 🚨 CORRECTION URGENTE - ERREUR DOCKER ENTRYPOINT
|
||||
|
||||
## Problème actuel
|
||||
Le conteneur Docker ne peut pas démarrer à cause de l'erreur :
|
||||
```
|
||||
exec /app/docker-entrypoint.sh: no such file or directory
|
||||
```
|
||||
|
||||
## 🔧 Solution immédiate (1 commande)
|
||||
|
||||
**Créer directement la table announcements :**
|
||||
```bash
|
||||
docker exec logiflow-logiflow-1 psql $DATABASE_URL -c "CREATE TABLE IF NOT EXISTS announcements (id SERIAL PRIMARY KEY, title VARCHAR(255) NOT NULL, content TEXT NOT NULL, priority VARCHAR(20) NOT NULL DEFAULT 'normal', author_id VARCHAR(255) NOT NULL, group_id INTEGER, created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), CONSTRAINT announcements_priority_check CHECK (priority IN ('normal', 'important', 'urgent')), CONSTRAINT announcements_author_id_fkey FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE, CONSTRAINT announcements_group_id_fkey FOREIGN KEY (group_id) REFERENCES groups(id) ON DELETE CASCADE);"
|
||||
```
|
||||
|
||||
## 🛠️ Correction du Docker (pour arrêter les erreurs)
|
||||
|
||||
**Reconstruire le conteneur avec le Dockerfile corrigé :**
|
||||
```bash
|
||||
# Arrêter le conteneur actuel
|
||||
docker-compose down
|
||||
|
||||
# Reconstruire sans entrypoint
|
||||
docker-compose up --build -d
|
||||
```
|
||||
|
||||
## ✅ Résultat
|
||||
- Table announcements créée
|
||||
- Conteneur Docker fonctionnel
|
||||
- Plus d'erreurs d'entrypoint
|
||||
- Système d'annonces opérationnel
|
||||
|
||||
## 📋 Vérification
|
||||
```bash
|
||||
# Vérifier que la table existe
|
||||
docker exec logiflow-logiflow-1 psql $DATABASE_URL -c "SELECT EXISTS (SELECT FROM information_schema.tables WHERE table_name='announcements');"
|
||||
```
|
||||
Reference in new issue
Block a user