- PR1: Project scaffold, DB models, price loader - PR2: Congressional trade ingestion (House Stock Watcher) - PR3: Security enrichment + deployment infrastructure - 37 passing tests, 87%+ coverage - Docker + Proxmox deployment ready - Complete documentation - Works 100% offline with fixtures
5.0 KiB
5.0 KiB
Proxmox Quick Start ⚡
Got Proxmox? Deploy POTE in 5 minutes!
TL;DR (Super Quick)
# 1. Create Ubuntu 22.04 LXC container (2GB RAM, 2 cores, 8GB disk)
# 2. Enter container and run:
curl -fsSL https://raw.githubusercontent.com/your-repo/pote/main/scripts/proxmox_setup.sh | sudo bash
# 3. Switch to app user and test:
su - poteapp
cd pote && source venv/bin/activate
python scripts/ingest_from_fixtures.py
# Done! ✅
Step-by-Step (10 minutes)
1. Create LXC Container
Via Proxmox Web UI:
- Click "Create CT"
- Template: Ubuntu 22.04
- Hostname:
pote - Memory: 2048 MB
- CPU cores: 2
- Disk: 8 GB
- Network: Bridge, DHCP
- Create!
Via Command Line (on Proxmox host):
pct create 100 local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst \
--hostname pote \
--memory 2048 \
--cores 2 \
--rootfs local-lvm:8 \
--net0 name=eth0,bridge=vmbr0,ip=dhcp \
--unprivileged 1
pct start 100
2. Enter Container
pct enter 100
# Or SSH: ssh root@container-ip
3. Run Setup Script
# Option A: If repo already cloned
cd /path/to/pote
sudo bash scripts/proxmox_setup.sh
# Option B: Download and run
curl -fsSL https://your-repo/scripts/proxmox_setup.sh | sudo bash
4. Test It!
# Switch to app user
su - poteapp
# Activate venv
cd pote
source venv/bin/activate
# Test with fixtures (offline)
python scripts/ingest_from_fixtures.py
# Should see:
# ✓ Officials created: 4
# ✓ Trades ingested: 5
5. Setup Cron Jobs
# As poteapp user
crontab -e
# Add these lines:
0 6 * * * cd /home/poteapp/pote && /home/poteapp/pote/venv/bin/python scripts/fetch_congressional_trades.py --days 7 >> /home/poteapp/logs/trades.log 2>&1
15 6 * * * cd /home/poteapp/pote && /home/poteapp/pote/venv/bin/python scripts/enrich_securities.py >> /home/poteapp/logs/enrich.log 2>&1
6. Done! 🎉
Your POTE instance is now running and will:
- Fetch congressional trades daily at 6 AM
- Enrich securities daily at 6:15 AM
- Store everything in PostgreSQL
What You Get
✅ Full PostgreSQL database
✅ Automated daily updates (via cron)
✅ Isolated environment (LXC container)
✅ Easy backups (Proxmox snapshots)
✅ Low resource usage (500MB RAM)$5-10/mo)
✅ Cost: Just electricity (
Quick Commands
# Enter container
pct enter 100
# Check status
systemctl status postgresql
# View logs
tail -f /home/poteapp/logs/trades.log
# Manual ingestion
su - poteapp
cd pote && source venv/bin/activate
python scripts/fetch_congressional_trades.py --days 30
# Database backup
sudo -u postgres pg_dump pote > backup.sql
# Check database size
sudo -u postgres psql -c "SELECT pg_size_pretty(pg_database_size('pote'));"
Resource Usage
Idle:
- RAM: ~500 MB
- CPU: <1%
- Disk: ~2 GB
During ingestion:
- RAM: ~800 MB
- CPU: 10-20%
- Duration: ~30 seconds
After 1 month:
- Disk: ~3-4 GB
- Database: ~500 MB
Maintenance
Weekly
# Backup database
pct exec 100 -- sudo -u postgres pg_dump pote > pote_backup_$(date +%Y%m%d).sql
# Or via Proxmox snapshots (easier!)
# Web UI: Container → Snapshots → Take Snapshot
Monthly
# Update system
pct exec 100 -- apt update && apt upgrade -y
# Vacuum database
pct exec 100 -- sudo -u postgres psql pote -c "VACUUM ANALYZE;"
# Clean old logs
pct exec 100 -- find /home/poteapp/logs -name "*.log" -mtime +30 -delete
Troubleshooting
Can't connect to database
pct enter 100
systemctl status postgresql
# If stopped: systemctl start postgresql
Out of disk space
# Check usage
pct exec 100 -- df -h
# Resize on Proxmox host
pct resize 100 rootfs +5G
Cron jobs not running
# Check cron is running
pct exec 100 -- systemctl status cron
# Check crontab
pct exec 100 -- su - poteapp -c "crontab -l"
# Check logs
pct exec 100 -- tail -f /home/poteapp/logs/trades.log
Python errors
# Reinstall dependencies
pct enter 100
su - poteapp
cd pote
rm -rf venv
python3.11 -m venv venv
source venv/bin/activate
pip install -e .
Next Steps
- ✅ Container running
- ✅ POTE installed
- ✅ Data ingested
- ⏭️ Setup Proxmox backups (Web UI → Datacenter → Backup)
- ⏭️ Configure static IP (if needed)
- ⏭️ Build Phase 2 analytics
- ⏭️ Add FastAPI dashboard
Advanced: Static IP
# On Proxmox host, edit container config
nano /etc/pve/lxc/100.conf
# Change:
net0: name=eth0,bridge=vmbr0,ip=192.168.1.50/24,gw=192.168.1.1
# Restart
pct restart 100
Full Documentation
- Complete guide:
docs/08_proxmox_deployment.md - General deployment:
docs/07_deployment.md - Docker option:
docker-compose.yml
Your Proxmox = Enterprise infrastructure at hobby prices! 🚀
Cost breakdown:
- Cloud VPS: $20/mo
- Your Proxmox: ~$10/mo (power)
- Savings: $120/year ✨