- Docker 20.10+ and Docker Compose 1.29+
- Node.js 18+ and npm 9+ (for building)
- Access to a cloud provider (AWS/GCP/Azure)
- Domain name (optional but recommended)
- 2+ CPU cores
- 4GB+ RAM
- 20GB+ disk space
- Ubuntu 22.04 LTS
# Update system
sudo apt update && sudo apt upgrade -y
# Install required packages
sudo apt install -y git curl htop ufw
# Configure firewall
sudo ufw allow OpenSSH
sudo ufw allow http
sudo ufw allow https
sudo ufw enable# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
# Add current user to docker group
sudo usermod -aG docker $USER
# Install Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose# Clone repository
git clone https://github.com/DevOpsTerminal/text2iac.git
cd text2iac
# Copy and configure environment variables
cp .env.example .env
nano .env # Edit with your configuration
# Build and start containers
make build
make start-
Install Nginx:
sudo apt install -y nginx
-
Create Nginx configuration:
sudo nano /etc/nginx/sites-available/text2iac
server { listen 80; server_name your-domain.com; location / { proxy_pass http://localhost:8080; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } location /api { proxy_pass http://localhost:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } }
-
Enable the site:
sudo ln -s /etc/nginx/sites-available/text2iac /etc/nginx/sites-enabled/ sudo nginx -t sudo systemctl restart nginx
# Install Certbot
sudo apt install -y certbot python3-certbot-nginx
# Obtain SSL certificate
sudo certbot --nginx -d your-domain.com
# Test automatic renewal
sudo certbot renew --dry-run| Variable | Required | Description | Default |
|---|---|---|---|
NODE_ENV |
No | Node environment | production |
PORT |
No | API server port | 3000 |
OPENAI_API_KEY |
Yes | OpenAI API key | |
JWT_SECRET |
Yes | JWT secret key | |
DATABASE_URL |
Yes | Database connection URL | |
REDIS_URL |
No | Redis connection URL | redis://redis:6379 |
-
API Service:
# docker-compose.yml api: image: text2iac/api:latest deploy: replicas: 3 resources: limits: cpus: '0.5' memory: 1G
-
Load Balancing:
- Use a load balancer (AWS ALB, Nginx, Traefik)
- Configure sticky sessions if needed
For production, consider using managed database services:
- AWS RDS
- Google Cloud SQL
- Azure Database
# View logs
docker-compose logs -f
# Set up log rotation
sudo nano /etc/logrotate.d/docker- Prometheus for metrics collection
- Grafana for visualization
- Sentry for error tracking
-
Database Backup:
# Create backup docker-compose exec -T db pg_dump -U postgres text2iac > backup.sql # Restore cat backup.sql | docker-compose exec -T db psql -U postgres text2iac
-
Volume Backup:
# Create backup
tar -czf data_backup.tar.gz /var/lib/docker/volumes/text2iac_*
## Maintenance
### Updating
```bash
git pull
docker-compose build --no-cache
docker-compose up -d --force-recreate
# Check container status
docker ps
# Check logs
docker-compose logs -f
# Check disk usage
df -h-
Port Conflicts:
- Check if ports 80, 443, 3000 are in use
- Use
netstat -tuln | grep <port>to check
-
Docker Issues:
# Restart Docker sudo systemctl restart docker # Check container logs docker logs <container_id>
-
Database Connection Issues:
- Verify database URL in
.env - Check if database is running:
docker-compose ps db
- Verify database URL in
For additional help, please open an issue on our GitHub repository.