From bd85c1257df4b5fd8987fbf84969949dd1f65df0 Mon Sep 17 00:00:00 2001 From: marco370 <48531002-marco370@users.noreply.replit.com> Date: Thu, 16 Oct 2025 07:17:26 +0000 Subject: [PATCH] Add automatic deployment system for production environments Implement a full CI/CD pipeline using GitLab for automatic deployment to AlmaLinux 9 servers, including server setup scripts, Nginx configuration with SSL, and automated PostgreSQL password generation. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 99f0fce6-9386-489a-9632-1d81223cab44 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80/99f0fce6-9386-489a-9632-1d81223cab44/3WCtEVl --- .replit | 4 ++++ replit.md | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/.replit b/.replit index d41ea9d..6007d8a 100644 --- a/.replit +++ b/.replit @@ -18,6 +18,10 @@ externalPort = 80 localPort = 33035 externalPort = 3001 +[[ports]] +localPort = 34329 +externalPort = 3003 + [[ports]] localPort = 41343 externalPort = 3000 diff --git a/replit.md b/replit.md index 69e232c..12549c3 100644 --- a/replit.md +++ b/replit.md @@ -312,6 +312,41 @@ All interactive elements have `data-testid` attributes for automated testing. - Query con ordering e filtering per date/status - Aggiunto SEO completo (title, meta description, Open Graph) - Tutti i componenti testabili con data-testid attributes +- **Sistema Deployment Automatico** ✅: + - Pipeline CI/CD GitLab (.gitlab-ci.yml) con stages build/test/deploy + - Script setup server AlmaLinux 9 (deploy/setup-server.sh) + - Script deployment automatico (deploy/deploy.sh) + - Configurazione Nginx reverse proxy con SSL + - Password PostgreSQL autogenerata (sicurezza) + - Workflow: Replit → GitLab → CI/CD → Server produzione + - Documentazione completa (DEPLOYMENT.md, QUICKSTART-DEPLOYMENT.md) + - Helper script push-to-gitlab.sh per deployment rapido + +## Deployment + +### Setup Produzione +Il sistema supporta deployment automatico su server AlmaLinux 9 tramite GitLab CI/CD: + +**Workflow Deployment:** +``` +Replit (modifiche) → Git Push → GitLab CI/CD → Deploy Server +``` + +**File Deployment:** +- `.gitlab-ci.yml` - Pipeline CI/CD (build, test, deploy, rollback) +- `deploy/setup-server.sh` - Setup iniziale server (Node, PostgreSQL, Nginx, PM2) +- `deploy/deploy.sh` - Script deployment automatico +- `deploy/nginx.conf` - Configurazione reverse proxy +- `.env.production.example` - Template variabili ambiente produzione + +**Documentazione:** +- `DEPLOYMENT.md` - Guida completa step-by-step +- `QUICKSTART-DEPLOYMENT.md` - Setup rapido 15 minuti + +**Security:** +- Password PostgreSQL autogenerata (non hard-coded) +- SSL/TLS con Let's Encrypt +- Firewall configurato automaticamente ## Future Enhancements