# Development
./scripts/deploy-dev.sh up # Start
./scripts/deploy-dev.sh down # Stop
./scripts/deploy-dev.sh restart # Restart
./scripts/deploy-dev.sh logs # Tail logs
./scripts/deploy-dev.sh health # Health check
./scripts/deploy-dev.sh doctor # Diagnose
# Production
./scripts/deploy-prod.sh deploy # Deploy
./scripts/deploy-prod.sh rollback # Rollback
./scripts/deploy-prod.sh backup # Backup DB
./scripts/deploy-prod.sh health # Health check
./scripts/deploy-prod.sh status # Show status
./scripts/deploy-prod.sh down # Stop# View running containers
docker compose -f docker-compose.prod.yml ps
# View logs
docker compose -f docker-compose.prod.yml logs -f itsm-backend
docker compose -f docker-compose.prod.yml logs -f itsm-frontend
# Restart service
docker compose -f docker-compose.prod.yml restart itsm-backend
# Access container shell
docker exec -it itsm-backend-prod sh
docker exec -it itsm-postgres-prod psql -U postgres -d itsm| Service | URL |
|---|---|
| Backend | http://localhost:8090/api/v1/health |
| Frontend | http://localhost:3000 |
| MinIO | http://localhost:9000/minio/health/live |
If monitoring stack is deployed:
- Prometheus:
http://localhost:9090 - Grafana:
http://localhost:3001(admin/admin)
Key metrics:
itsm_ticket_total- Total tickets by statusitsm_api_request_duration_seconds- API latencyitsm_sla_breaches_total- SLA breaches
Backend logs (JSON format):
{
"level": "info",
"ts": "2026-05-16T08:00:00Z",
"caller": "handler.go:42",
"msg": "Ticket created",
"ticket_id": "123e4567-e89b-12d3-a456-426614174000"
}| Level | Use |
|---|---|
| debug | Development only |
| info | Normal operation |
| warn | Recoverable issues |
| error | Failures requiring attention |
Docker handles log rotation. Configure in daemon.json:
{
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3"
}
}Backups are created automatically during each production deployment:
# List backups
ls -la backups/
# Restore from backup
gunzip < backups/itsm_prod_20260516_150229.sql.gz | psql -U postgres -d itsm# Database only
docker compose -f docker-compose.prod.yml exec postgres pg_dump -U postgres itsm > backups/manual_$(date +%Y%m%d).sql
# Full stack backup
tar -czf itsm_backup_$(date +%Y%m%d).tar.gz \
backups/ \
.env.prod \
nginx/conf.d/Key GOMAXPROCS and connection pool settings:
# Set CPU cores
GOMAXPROCS=4
# Database pool
MAX_OPEN_CONNS=25
MAX_IDLE_CONNS=5Next.js standalone mode minimizes memory footprint:
# Reduce Node.js memory
NODE_OPTIONS="--max-old-space-size=512"PostgreSQL tuning in postgresql.conf:
max_connections = 100
shared_buffers = 256MB
effective_cache_size = 1GB
maintenance_work_mem = 64MB
wal_buffers = 16MB
checkpoint_completion_target = 0.9- Change default passwords -
admin123must be changed - Restrict CORS - Set
ITSM_ALLOW_ALL_ORIGINS=false - Enable HTTPS - Terminate SSL at reverse proxy
- Rotate secrets - Update JWT_SECRET periodically
- Network isolation - Use Docker networks, don't expose DB port
- Rate limiting - Configure nginx rate limits
- Regular updates - Enable Dependabot for dependency updates
# Check logs
docker compose -f docker-compose.prod.yml logs itsm-backend
# Common causes:
# - Port already in use
# - Missing environment variables
# - Database not ready# Check container stats
docker stats
# Restart heavy containers
docker compose -f docker-compose.prod.yml restart --no-deps itsm-frontend# Test connectivity
docker compose -f docker-compose.prod.yml exec postgres pg_isready -U postgres
# Check connection string
docker compose -f docker-compose.prod.yml exec itsm-backend env | grep DB_For zero-downtime deployments, use rolling updates:
# Pull latest images
docker pull itsm-backend:latest
docker pull itsm-frontend:latest
# Rolling restart
docker compose -f docker-compose.prod.yml up -d --no-deps itsm-backend
docker compose -f docker-compose.prod.yml up -d --no-deps itsm-frontend- Restore database from latest backup
- Pull images:
docker pullall services - Deploy:
./scripts/deploy-prod.sh deploy - Verify:
./scripts/deploy-prod.sh health
PostgreSQL WAL archiving for precise recovery:
# Enable in docker-compose.prod.yml
POSTGRES_HOST_AUTH_METHOD=trust # NEVER in production
# Use pgBackRest or Barman for production WAL archiving