Update deployment to use Nginx reverse proxy network

Configure docker-compose.yml and DOCKER.md to enable Nginx reverse proxy access by making the application and PostgreSQL available on the `nginx_default` external network.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/MNNRXY7
This commit is contained in:
michaelschal committed 2025-10-17 13:04:49 +00:00
1 parent 990542ff0f
commit 5bd45764b4
3 files changed
+14 -29

No files matched your search

+8 -22
View File
@@ -54,39 +54,25 @@ docker-compose down
### Réseau interne (`internal`) ### Réseau interne (`internal`)
- PostgreSQL et l'application communiquent sur ce réseau privé - PostgreSQL et l'application communiquent sur ce réseau privé
- La base de données n'est **pas exposée** sur l'hôte pour plus de sécurité
### Réseau nginx (`nginx_default`) - OPTIONNEL ### Réseau nginx (`nginx_default`)
- Réseau externe pour le reverse proxy Nginx - Réseau externe pour le reverse proxy Nginx
- **Par défaut : désactivé** (commenté dans docker-compose.yml) - PostgreSQL et l'application sont sur ce réseau
- Décommentez-le uniquement si vous utilisez Nginx - Permet l'accès via Nginx et un domaine personnalisé
## 📝 Configuration Nginx (optionnelle) ## 📝 Configuration Nginx
### Activation du réseau Nginx ### Prérequis : Créer le réseau nginx
Si vous utilisez Nginx comme reverse proxy : **Avant de lancer docker-compose**, créez le réseau nginx (une seule fois) :
1. **Créer le réseau Docker nginx** (une seule fois) :
```bash ```bash
docker network create nginx_default docker network create nginx_default
``` ```
2. **Décommenter dans docker-compose.yml** : ### Configuration Nginx
```yaml
# Dans la section app > networks :
networks:
- internal
- nginx_default # ← Décommentez cette ligne
# Dans la section networks en bas du fichier : Mettez à jour votre configuration Nginx pour cibler le port **4523** :
networks:
# ...
nginx_default:
external: true # ← Décommentez ces 2 lignes
```
3. **Mettre à jour votre configuration Nginx** pour cibler le port **4523** :
```nginx ```nginx
upstream socialflow { upstream socialflow {
+5 -6
View File
@@ -14,6 +14,7 @@ services:
- postgres_data:/var/lib/postgresql/data - postgres_data:/var/lib/postgresql/data
networks: networks:
- internal - internal
- nginx_default
# Port non exposé sur l'hôte pour plus de sécurité en production # 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 # Décommentez la ligne suivante si vous avez besoin d'accéder à la DB localement
# ports: # ports:
@@ -42,8 +43,7 @@ services:
APP_URL: ${APP_URL:-http://localhost:4523} APP_URL: ${APP_URL:-http://localhost:4523}
networks: networks:
- internal - internal
# Décommentez la ligne suivante si vous utilisez Nginx reverse proxy : - nginx_default
# - nginx_default
depends_on: depends_on:
postgres: postgres:
condition: service_healthy condition: service_healthy
@@ -58,7 +58,6 @@ networks:
internal: internal:
driver: bridge driver: bridge
# Réseau externe pour nginx reverse proxy (optionnel) # Réseau externe pour nginx reverse proxy
# Décommentez si vous utilisez Nginx : nginx_default:
# nginx_default: external: true
# external: true
+1 -1
View File
@@ -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 for security. Updated Dockerfile to use port 4523. Optional nginx reverse proxy support (commented by default). Created comprehensive DOCKER.md documentation with setup instructions, network architecture explanation, security best practices, and troubleshooting guide. - **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.
### 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.