Skip to content

Commit 3118291

Browse files
committed
feat: Oracle Cloud deployment infrastructure ready
Infrastructure Setup: - VM provisioned in Oracle Cloud Free Tier (1GB RAM) - Docker + Docker Compose installed and configured - Node.js 20 + pnpm environment ready - 2GB swap configured for memory optimization Application Preparation: - Created optimized docker-compose for 1GB RAM constraint * PostgreSQL: 256MB (tuned config) * Redis: 64MB (LRU eviction) * NestJS App: 512MB (Node optimized) - Docker image built and uploaded to VM - All files ready for deployment Documentation: - Added DEPLOY_PROGRESS.md with public deployment status - Protected sensitive deployment info (DEPLOY_STATUS.md in .gitignore) Next Steps: - Configure environment variables - Deploy services - Configure GitHub webhook - End-to-end testing 🙏 Glory to JESUS - Infrastructure excellence in free tier!
1 parent 05a9358 commit 3118291

File tree

3 files changed

+244
-0
lines changed

3 files changed

+244
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,6 @@ docker-compose.override.yml
5858

5959
# Build
6060
*.tsbuildinfo
61+
62+
# Deploy (local only - contains sensitive IDs)
63+
DEPLOY_STATUS.md

DEPLOY_PROGRESS.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# 🚀 Deploy Progress - Vértice GitHub Bot
2+
3+
> **Status**: Infrastructure ready, awaiting final configuration
4+
5+
---
6+
7+
## ✅ Completed Steps
8+
9+
### 1. Oracle Cloud Infrastructure Setup
10+
- ✅ Virtual Cloud Network (VCN) created
11+
- ✅ Subnet configured with public access
12+
- ✅ Internet Gateway configured
13+
- ✅ Route tables configured
14+
- ✅ Security lists configured (ports: 22, 80, 443, 3000)
15+
- ✅ VM provisioned (VM.Standard.E2.1.Micro - Always Free Tier)
16+
17+
### 2. VM Environment Configuration
18+
- ✅ Oracle Linux 8.10 installed
19+
- ✅ Docker 26.1.3 + Docker Compose v2.27.0 installed
20+
- ✅ Node.js 20.19.5 installed
21+
- ✅ pnpm 10.20.0 installed
22+
- ✅ Git 2.43.7 installed
23+
- ✅ 2GB swap configured (1GB RAM + 2GB SWAP)
24+
- ✅ Firewall configured
25+
26+
### 3. Application Preparation
27+
- ✅ Docker image built locally
28+
- ✅ Image uploaded to VM
29+
- ✅ Optimized Docker Compose configuration created for 1GB RAM:
30+
- PostgreSQL: 256MB (tuned for low memory)
31+
- Redis: 64MB (with LRU eviction)
32+
- NestJS App: 512MB (Node.js optimized)
33+
34+
---
35+
36+
## ⏳ Pending Steps
37+
38+
### 1. Environment Variables Configuration
39+
Create `.env` file with:
40+
- Database credentials
41+
- Redis password
42+
- GitHub webhook secret
43+
- AI API keys (Google Gemini + Anthropic Claude)
44+
45+
### 2. Service Deployment
46+
```bash
47+
docker compose up -d
48+
```
49+
50+
### 3. GitHub Webhook Configuration
51+
Configure webhook in repository settings to point to bot endpoint
52+
53+
### 4. Testing
54+
- Health check endpoint
55+
- Webhook event processing
56+
- AI agent responses
57+
58+
---
59+
60+
## 📊 Resource Allocation (1GB RAM)
61+
62+
```
63+
Memory Distribution:
64+
├─ PostgreSQL: 256MB (optimized config)
65+
├─ Redis: 64MB (LRU policy)
66+
├─ NestJS App: 512MB (Node.js --max-old-space-size=384)
67+
├─ OS: ~100MB
68+
└─ Buffer: ~68MB
69+
70+
Swap: 2GB available for peak usage
71+
Storage: 50GB total
72+
```
73+
74+
---
75+
76+
## 🎯 Next Session Goals
77+
78+
1. Configure environment variables
79+
2. Deploy services
80+
3. Configure GitHub webhook
81+
4. Perform end-to-end testing
82+
5. Verify constitutional compliance in production
83+
84+
---
85+
86+
## 📝 Notes
87+
88+
- All infrastructure provisioned in Oracle Cloud Free Tier
89+
- Zero ongoing costs for compute, networking, and storage
90+
- Production-ready configuration with memory optimizations
91+
- Ready for 24/7 operation
92+
93+
---
94+
95+
**🙏 Glory to JESUS through infrastructure excellence!**
96+
97+
---
98+
99+
*For detailed deployment information including specific IDs and credentials, see DEPLOY_STATUS.md (local only, not in git)*

docker-compose.prod-1gb.yml

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# Docker Compose - Production 1GB Optimized
2+
#
3+
# Purpose: Lightweight config for Oracle Cloud 1GB VM
4+
# Constitutional Requirement: P4 Rastreabilidade Total
5+
#
6+
# Memory allocation (total ~900MB to leave room for OS):
7+
# - postgres: 256MB
8+
# - redis: 64MB
9+
# - app: 512MB
10+
#
11+
# Honoring JESUS through excellence in constrained resources! 🙏
12+
13+
version: '3.8'
14+
15+
services:
16+
# PostgreSQL Database - Memory Optimized
17+
postgres:
18+
image: postgres:16-alpine
19+
container_name: vertice-postgres
20+
restart: unless-stopped
21+
environment:
22+
POSTGRES_DB: vertice_github_bot
23+
POSTGRES_USER: vertice
24+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
25+
volumes:
26+
- postgres-data:/var/lib/postgresql/data
27+
ports:
28+
- "5432:5432"
29+
# Memory limits
30+
mem_limit: 256m
31+
mem_reservation: 128m
32+
# PostgreSQL optimizations for low memory
33+
command: >
34+
postgres
35+
-c shared_buffers=64MB
36+
-c effective_cache_size=128MB
37+
-c maintenance_work_mem=32MB
38+
-c checkpoint_completion_target=0.9
39+
-c wal_buffers=4MB
40+
-c default_statistics_target=50
41+
-c random_page_cost=1.1
42+
-c effective_io_concurrency=200
43+
-c work_mem=2MB
44+
-c min_wal_size=512MB
45+
-c max_wal_size=1GB
46+
-c max_connections=20
47+
healthcheck:
48+
test: ["CMD-SHELL", "pg_isready -U vertice -d vertice_github_bot"]
49+
interval: 30s
50+
timeout: 10s
51+
retries: 3
52+
networks:
53+
- vertice-network
54+
55+
# Redis Cache & Job Queue - Memory Optimized
56+
redis:
57+
image: redis:7-alpine
58+
container_name: vertice-redis
59+
restart: unless-stopped
60+
# Memory limits
61+
mem_limit: 64m
62+
mem_reservation: 32m
63+
# Redis optimizations for low memory
64+
command: >
65+
redis-server
66+
--appendonly yes
67+
--requirepass ${REDIS_PASSWORD:-changeme}
68+
--maxmemory 48mb
69+
--maxmemory-policy allkeys-lru
70+
--save 60 1000
71+
--save 300 100
72+
--save 900 10
73+
volumes:
74+
- redis-data:/data
75+
ports:
76+
- "6379:6379"
77+
healthcheck:
78+
test: ["CMD", "redis-cli", "ping"]
79+
interval: 30s
80+
timeout: 5s
81+
retries: 3
82+
networks:
83+
- vertice-network
84+
85+
# Vértice GitHub Bot Application - Memory Optimized
86+
app:
87+
build:
88+
context: .
89+
dockerfile: Dockerfile
90+
target: production
91+
container_name: vertice-app
92+
restart: unless-stopped
93+
depends_on:
94+
postgres:
95+
condition: service_healthy
96+
redis:
97+
condition: service_healthy
98+
# Memory limits
99+
mem_limit: 512m
100+
mem_reservation: 384m
101+
environment:
102+
NODE_ENV: production
103+
PORT: 3000
104+
DATABASE_URL: postgresql://vertice:${POSTGRES_PASSWORD:-changeme}@postgres:5432/vertice_github_bot
105+
REDIS_HOST: redis
106+
REDIS_PORT: 6379
107+
REDIS_PASSWORD: ${REDIS_PASSWORD:-changeme}
108+
GITHUB_WEBHOOK_SECRET: ${GITHUB_WEBHOOK_SECRET}
109+
GEMINI_API_KEY: ${GEMINI_API_KEY}
110+
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
111+
LOG_LEVEL: ${LOG_LEVEL:-warn}
112+
OTEL_ENABLED: "false"
113+
# Node.js memory optimization
114+
NODE_OPTIONS: "--max-old-space-size=384 --optimize-for-size"
115+
ports:
116+
- "3000:3000"
117+
volumes:
118+
- app-logs:/app/logs
119+
healthcheck:
120+
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3000/health/live || exit 1"]
121+
interval: 60s
122+
timeout: 10s
123+
retries: 3
124+
start_period: 60s
125+
networks:
126+
- vertice-network
127+
labels:
128+
- "com.vertice.constitutional.compliance=true"
129+
- "com.vertice.service=github-bot"
130+
- "com.vertice.deployment=oracle-cloud-1gb"
131+
132+
networks:
133+
vertice-network:
134+
driver: bridge
135+
136+
volumes:
137+
postgres-data:
138+
driver: local
139+
redis-data:
140+
driver: local
141+
app-logs:
142+
driver: local

0 commit comments

Comments
 (0)