diff --git a/.env.example b/.env.example index 73d870f..e4a1048 100644 --- a/.env.example +++ b/.env.example @@ -2,7 +2,7 @@ # Copiez ce fichier en .env et modifiez les valeurs selon vos besoins # Configuration de la base de données -DATABASE_URL=postgresql://regisflow:regisflow2024@localhost:5432/regisflow +DATABASE_URL=postgresql://regisflow:regisflow2024@postgres:5432/regisflow POSTGRES_PASSWORD=regisflow2024 # Configuration de l'application @@ -15,6 +15,7 @@ SESSION_SECRET=your-super-secret-session-key-change-in-production # Configuration du timezone TZ=Europe/Paris +# Note: L'application sera accessible sur http://localhost:5000 après le démarrage # Configuration optionnelle pour les sauvegardes BACKUP_RETENTION_DAYS=30 MAX_BACKUP_COUNT=10 \ No newline at end of file diff --git a/README_DOCKER.md b/README_DOCKER.md index 879a831..c19b088 100644 --- a/README_DOCKER.md +++ b/README_DOCKER.md @@ -55,8 +55,7 @@ docker-compose up -d docker-compose logs -f # Accéder à l'application -# http://localhost (avec nginx) -# ou http://localhost:5000 (accès direct) +# http://localhost:5000 ``` ## 📋 Services Inclus @@ -73,11 +72,7 @@ docker-compose logs -f - **Sauvegardes**: Volume `backup_data` - **Health check**: `/health` -### 3. Nginx (Reverse Proxy) -- **Port**: 80 (HTTP) -- **Port**: 443 (HTTPS - à configurer) -- **Compression**: Gzip activée -- **Cache**: Optimisé pour les assets statiques + ## 🔧 Commandes Utiles @@ -239,12 +234,12 @@ L'application gère automatiquement les migrations de base de données au démar ## 📝 Configuration Avancée -### Personnalisation de Nginx +### Accès via Reverse Proxy (Optionnel) -Éditez le fichier `nginx.conf` pour : -- Configurer SSL/TLS -- Ajouter des règles de sécurité -- Optimiser les performances +Si vous souhaitez ajouter un reverse proxy (Nginx, Apache, etc.) : +- Configurez le proxy pour pointer vers `localhost:5000` +- Ajoutez la configuration SSL/TLS si nécessaire +- Optimisez les performances selon vos besoins ### Variables d'environnement complètes diff --git a/docker-compose.yml b/docker-compose.yml index 7f5d3f8..85e5784 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -50,20 +50,7 @@ services: retries: 3 start_period: 60s - # Nginx reverse proxy (optionnel) - nginx: - image: nginx:alpine - container_name: regisflow-nginx - depends_on: - - regisflow - volumes: - - ./nginx.conf:/etc/nginx/nginx.conf:ro - ports: - - "80:80" - - "443:443" - networks: - - regisflow-network - restart: unless-stopped + volumes: postgres_data: diff --git a/nginx.conf b/nginx.conf deleted file mode 100644 index 7d8d7ba..0000000 --- a/nginx.conf +++ /dev/null @@ -1,79 +0,0 @@ -events { - worker_connections 1024; -} - -http { - include /etc/nginx/mime.types; - default_type application/octet-stream; - - # Configuration des logs - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; - - access_log /var/log/nginx/access.log main; - error_log /var/log/nginx/error.log warn; - - # Configuration générale - sendfile on; - tcp_nopush on; - tcp_nodelay on; - keepalive_timeout 65; - types_hash_max_size 2048; - - # Configuration de compression - gzip on; - gzip_vary on; - gzip_min_length 10240; - gzip_proxied expired no-cache no-store private must-revalidate auth; - gzip_types - text/plain - text/css - text/xml - text/javascript - application/javascript - application/xml+rss - application/json; - - # Configuration du serveur - server { - listen 80; - server_name localhost; - - # Limite de taille des fichiers - client_max_body_size 50M; - - # Configuration des headers de sécurité - add_header X-Frame-Options "SAMEORIGIN" always; - add_header X-Content-Type-Options "nosniff" always; - add_header X-XSS-Protection "1; mode=block" always; - add_header Referrer-Policy "strict-origin-when-cross-origin" always; - - # Proxy vers l'application RegisFlow - location / { - proxy_pass http://regisflow:5000; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_cache_bypass $http_upgrade; - proxy_read_timeout 86400; - } - - # Configuration pour les fichiers statiques - location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { - proxy_pass http://regisflow:5000; - expires 1y; - add_header Cache-Control "public, immutable"; - } - - # Health check - location /health { - proxy_pass http://regisflow:5000/health; - access_log off; - } - } -} \ No newline at end of file diff --git a/replit.md b/replit.md index 83e2c75..dd2ffc5 100644 --- a/replit.md +++ b/replit.md @@ -124,9 +124,9 @@ Preferred communication style: Simple, everyday language. ### Docker Deployment - **Container Strategy**: Multi-stage Docker build for optimized production images -- **Service Architecture**: Docker Compose with PostgreSQL, Nginx, and application containers +- **Service Architecture**: Docker Compose with PostgreSQL and application containers - **Database**: PostgreSQL 15 with persistent volumes and automated initialization -- **Reverse Proxy**: Nginx with compression, caching, and security headers +- **Direct Access**: Application accessible directly on port 5000 - **Health Monitoring**: Health checks for all services with automatic recovery - **Volume Management**: Persistent storage for database and backup data - **Environment**: Complete environment variable configuration with security templates @@ -204,10 +204,11 @@ Preferred communication style: Simple, everyday language. ### Docker Configuration (January 9, 2025) - ✅ Complete Docker setup with multi-stage build for production optimization -- ✅ Docker Compose configuration with PostgreSQL, Nginx, and application services +- ✅ Docker Compose configuration with PostgreSQL and application services - ✅ Automated database initialization and migration scripts - ✅ Health checks and proper container orchestration - ✅ Production-ready configuration with security best practices - ✅ Persistent volumes for database and backup data - ✅ Environment variable configuration with .env.example template -- ✅ Comprehensive Docker documentation with deployment instructions \ No newline at end of file +- ✅ Comprehensive Docker documentation with deployment instructions +- ✅ Nginx configuration removed for simplified deployment (application accessible on port 5000) \ No newline at end of file