Infrastructure & deployment repository for hapo-ai-hub.
This repo contains Docker Compose configs, Nginx setup, and deployment scripts. No source code here - Docker images are pulled from GitHub Container Registry (GHCR).
Each partner/customer clones this repo once and configures their own .env.
# 1. Clone this repo
git clone https://github.com/hapo-nghialuu/hapo-ai-hub-infra.git
cd hapo-ai-hub-infra
# 2. Setup config (interactive wizard)
./scripts/setup-env.sh
# Or manually:
cp .env.example .env
vi .env # Fill in your values
# 3. Login GHCR
export GHCR_TOKEN=your_github_token
echo "$GHCR_TOKEN" | docker login ghcr.io -u hapo-nghialuu --password-stdin
# 4. Deploy
chmod +x scripts/*.sh
./scripts/deploy.shOn a fresh Ubuntu server:
curl -fsSL https://raw.githubusercontent.com/hapo-nghialuu/hapo-ai-hub-infra/main/scripts/setup-server.sh | bashThis will:
- Install Docker & Docker Compose
- Configure firewall (ports 22, 80, 443)
- Clone this repo
- Generate random secrets for .env
./scripts/upgrade.sh v1.0.5./scripts/backup.shhapo-ai-hub-infra/
├── docker-compose.yml # Main orchestration
├── .env.example # Config template (copy to .env)
├── docker/
│ ├── nginx/
│ │ └── default.conf.template
│ ├── cliproxy/
│ │ └── config.yaml
│ └── mysql/
│ └── init.sql
├── scripts/
│ ├── setup-server.sh # Prepare fresh server
│ ├── setup-env.sh # Interactive .env wizard
│ ├── deploy.sh # Deploy services
│ ├── upgrade.sh # Upgrade versions
│ └── backup.sh # Backup databases
└── README.md
| Service | Port | Description |
|---|---|---|
| mysql | 3306 | MySQL 8 database |
| redis | 6379 | Redis cache |
| cliproxy | 8317 | CLIProxyAPI proxy |
| gateway | 18080 | Go API gateway |
| portal | 3000 | Next.js admin dashboard |
| nginx | 80, 443 | Reverse proxy + SSL |
| certbot | - | Auto-renew SSL |
See .env.example for all available options.
- Configure
DOMAINandCERTBOT_EMAILin.env - Run
./scripts/deploy.sh(auto-configures SSL) - SSL auto-renews via certbot
# Check service status
docker compose ps
# View logs
docker compose logs -f
# Restart specific service
docker compose restart gateway
# Check health
curl http://localhost:18080/health