mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-23 23:18:12 +02:00
5 files changed
+23
-22
No files matched your search
+4
-4
@@ -2,16 +2,16 @@
|
|||||||
PGDATABASE=socialflow
|
PGDATABASE=socialflow
|
||||||
PGUSER=socialflow
|
PGUSER=socialflow
|
||||||
PGPASSWORD=changeme
|
PGPASSWORD=changeme
|
||||||
PGPORT=5432
|
PGPORT=4523
|
||||||
PGHOST=postgres
|
PGHOST=postgres
|
||||||
|
|
||||||
# URL de connexion complète (générée automatiquement dans Docker)
|
# URL de connexion complète (générée automatiquement dans Docker)
|
||||||
DATABASE_URL=postgresql://socialflow:changeme@postgres:5432/socialflow
|
DATABASE_URL=postgresql://socialflow:changeme@postgres:4523/socialflow
|
||||||
|
|
||||||
# Configuration de l'application
|
# Configuration de l'application
|
||||||
PORT=4523
|
PORT=5555
|
||||||
NODE_ENV=production
|
NODE_ENV=production
|
||||||
APP_URL=http://localhost:4523
|
APP_URL=http://localhost:5555
|
||||||
|
|
||||||
# Clé secrète pour les sessions (CHANGEZ CETTE VALEUR)
|
# Clé secrète pour les sessions (CHANGEZ CETTE VALEUR)
|
||||||
SESSION_SECRET=your-secret-key-change-me-to-random-string
|
SESSION_SECRET=your-secret-key-change-me-to-random-string
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ docker-compose logs -f
|
|||||||
docker-compose down
|
docker-compose down
|
||||||
```
|
```
|
||||||
|
|
||||||
## 🌐 Accès à l'application
|
## 🌐 Accès
|
||||||
|
|
||||||
- **Accès direct** : http://localhost:4523
|
- **PostgreSQL** : Accessible sur le port **4523** (interne et externe)
|
||||||
- **Avec Nginx** (reverse proxy) : Voir section ci-dessous
|
- **Application** : Accessible via Nginx sur le réseau `nginx_default`
|
||||||
|
|
||||||
## 🔧 Architecture réseau
|
## 🔧 Architecture réseau
|
||||||
|
|
||||||
@@ -60,6 +60,10 @@ docker-compose down
|
|||||||
- PostgreSQL et l'application sont sur ce réseau
|
- PostgreSQL et l'application sont sur ce réseau
|
||||||
- Permet l'accès via Nginx et un domaine personnalisé
|
- Permet l'accès via Nginx et un domaine personnalisé
|
||||||
|
|
||||||
|
### Ports exposés
|
||||||
|
- **PostgreSQL** : `4523:4523` (port hôte 4523 → port container 4523)
|
||||||
|
- **Application** : Port 5555 interne (non exposé sur l'hôte, accessible via Nginx)
|
||||||
|
|
||||||
## 📝 Configuration Nginx
|
## 📝 Configuration Nginx
|
||||||
|
|
||||||
### Prérequis : Créer le réseau nginx
|
### Prérequis : Créer le réseau nginx
|
||||||
@@ -72,11 +76,11 @@ docker network create nginx_default
|
|||||||
|
|
||||||
### Configuration Nginx
|
### Configuration Nginx
|
||||||
|
|
||||||
Mettez à jour votre configuration Nginx pour cibler le port **4523** :
|
Configurez Nginx pour cibler l'application sur le port **5555** :
|
||||||
|
|
||||||
```nginx
|
```nginx
|
||||||
upstream socialflow {
|
upstream socialflow {
|
||||||
server socialflow-app:4523; # ← Utiliser le port 4523
|
server socialflow-app:5555; # ← Port interne de l'application
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
|
|||||||
+3
-3
@@ -34,12 +34,12 @@ RUN npm run build
|
|||||||
# Nettoyer les fichiers inutiles pour réduire la taille
|
# Nettoyer les fichiers inutiles pour réduire la taille
|
||||||
RUN rm -rf client node_modules/.cache
|
RUN rm -rf client node_modules/.cache
|
||||||
|
|
||||||
# Exposer le port de l'application (défini par ENV PORT)
|
# Exposer le port de l'application
|
||||||
EXPOSE 4523
|
EXPOSE 5555
|
||||||
|
|
||||||
# Variables d'environnement par défaut
|
# Variables d'environnement par défaut
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV PORT=4523
|
ENV PORT=5555
|
||||||
|
|
||||||
# Démarrer l'application
|
# Démarrer l'application
|
||||||
CMD ["npm", "run", "start"]
|
CMD ["npm", "run", "start"]
|
||||||
+6
-9
@@ -6,19 +6,18 @@ services:
|
|||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
container_name: socialflow-db
|
container_name: socialflow-db
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- "4523:4523"
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: ${PGDATABASE:-socialflow}
|
POSTGRES_DB: ${PGDATABASE:-socialflow}
|
||||||
POSTGRES_USER: ${PGUSER:-socialflow}
|
POSTGRES_USER: ${PGUSER:-socialflow}
|
||||||
POSTGRES_PASSWORD: ${PGPASSWORD:-changeme}
|
POSTGRES_PASSWORD: ${PGPASSWORD:-changeme}
|
||||||
|
PGPORT: 4523
|
||||||
volumes:
|
volumes:
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql/data
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
- nginx_default
|
- nginx_default
|
||||||
# Port non exposé sur l'hôte pour plus de sécurité en production
|
|
||||||
# Décommentez la ligne suivante si vous avez besoin d'accéder à la DB localement
|
|
||||||
# ports:
|
|
||||||
# - "${PGPORT:-5432}:5432"
|
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U ${PGUSER:-socialflow}"]
|
test: ["CMD-SHELL", "pg_isready -U ${PGUSER:-socialflow}"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
@@ -32,15 +31,13 @@ services:
|
|||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: socialflow-app
|
container_name: socialflow-app
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
|
||||||
- "4523:4523"
|
|
||||||
environment:
|
environment:
|
||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
PORT: 4523
|
PORT: 5555
|
||||||
DATABASE_URL: postgresql://${PGUSER:-socialflow}:${PGPASSWORD:-changeme}@postgres:5432/${PGDATABASE:-socialflow}
|
DATABASE_URL: postgresql://${PGUSER:-socialflow}:${PGPASSWORD:-changeme}@postgres:4523/${PGDATABASE:-socialflow}
|
||||||
OPENROUTER_API_KEY: ${OPENROUTER_API_KEY}
|
OPENROUTER_API_KEY: ${OPENROUTER_API_KEY}
|
||||||
SESSION_SECRET: ${SESSION_SECRET:-your-secret-key-change-me}
|
SESSION_SECRET: ${SESSION_SECRET:-your-secret-key-change-me}
|
||||||
APP_URL: ${APP_URL:-http://localhost:4523}
|
APP_URL: ${APP_URL:-http://localhost:5555}
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
- nginx_default
|
- nginx_default
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ Preferred communication style: Simple, everyday language.
|
|||||||
## Recent Changes
|
## Recent Changes
|
||||||
|
|
||||||
### October 17, 2025
|
### October 17, 2025
|
||||||
- **Docker Deployment Configuration**: Configured Docker Compose for private server deployment with PostgreSQL and application on same network. Application exposed on port 4523:4523 as requested. PostgreSQL and app communicate via internal Docker network and are both on nginx_default external network for reverse proxy access. Updated Dockerfile to use port 4523. Created comprehensive DOCKER.md documentation with setup instructions, network architecture explanation, and troubleshooting guide.
|
- **Docker Deployment Configuration**: Configured Docker Compose for private server deployment with PostgreSQL and application on same network. PostgreSQL exposed on port 4523:4523 for external access. Application runs on internal port 5555 (accessible via Nginx reverse proxy). Both PostgreSQL and app are on nginx_default external network and internal network for communication. Created comprehensive DOCKER.md documentation with setup instructions, network architecture explanation, and troubleshooting guide.
|
||||||
|
|
||||||
### October 14, 2025
|
### October 14, 2025
|
||||||
- **Publication History Error Display Fix**: Fixed bug where publication history incorrectly displayed persistent errors for posts that failed initially but succeeded on retry. Problem: When a post failed, the `error` field was populated, but when the post was successfully republished, only `publishedAt` and `externalPostId` were updated without clearing the `error` field. Solution: Modified `schedulerService.publishPost()` to set `error: null` when publication succeeds, ensuring error messages are cleared from the history view after successful republication.
|
- **Publication History Error Display Fix**: Fixed bug where publication history incorrectly displayed persistent errors for posts that failed initially but succeeded on retry. Problem: When a post failed, the `error` field was populated, but when the post was successfully republished, only `publishedAt` and `externalPostId` were updated without clearing the `error` field. Solution: Modified `schedulerService.publishPost()` to set `error: null` when publication succeeds, ensuring error messages are cleared from the history view after successful republication.
|
||||||
|
|||||||
Reference in new issue
Block a user