[CLUSTER_INFRASTRUCTURE_PROVISIONING]
Infrastructure, Cluster & Containers
VPS hardware specifications, container orchestration boundaries, volume bindings, and CI/CD automated deployment script suites.
// HOST_HARDWARE_NODE_SPECS
Production environment specs for budget VPS nodes:
Virtualization KVM Hypervisor VM
CPU Architect x86_64 Celeron Core
Core Threads 2 vCPUs (Shared Pool)
System Memory 1.0 GB RAM allocation
Storage Class 25 GB NVMe SSD RAID-10
Network Uplink 1 Gbps port link
OS Platform Debian 12 / Linux Kernel 6
* Managed self-hosted VPS nodes deployed in Central Europe. Total monthly cost metrics < $8.50.
// DOCKER_COMPOSE_INFRASTRUCTURE_MANIFEST
Production docker-compose.infra.yml structure showing resource caps, network isolation, and health checking blocks:
YAML
version: "3.8"
services:
postgresql:
image: pgvector/pgvector:pg15
container_name: ctos-postgresql
restart: unless-stopped
deploy:
resources:
limits:
memory: 100M
volumes:
- postgres-data:/var/lib/postgresql/data
- ./migrations:/docker-entrypoint-initdb.d:ro
networks:
- trading-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: ctos-redis
command: redis-server --maxmemory 64mb --maxmemory-policy allkeys-lru
deploy:
resources:
limits:
memory: 80M
volumes:
- redis-data:/data
networks:
- trading-network
rabbitmq:
image: rabbitmq:3.13-alpine
container_name: ctos-rabbitmq
deploy:
resources:
limits:
memory: 160M
volumes:
- rabbitmq-data:/var/lib/rabbitmq
- ./rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:ro
networks:
- trading-network
networks:
trading-network:
driver: bridge // DEPLOYMENT_AUTOMATION_SCRIPTS GITHUB_ACTIONS_&_POWERSHELL_PIPELINE
The systems are compiled and deployed automatically via **GitHub Actions** and self-hosted automation scripts. Deployments run in-place without downtime using parallel build steps and Docker cache layers.
// BUILD_AND_DEPLOY.PS1 (POWERSHELL SCRIPTS)
POWERSHELL
# build_and_deploy.ps1
param(
[string]$TargetIp = "192.168.1.137",
[string]$ConfigProfile = "docker"
)
Write-Host "Starting build execution..." -ForegroundColor Cyan
dotnet publish src/TradingBot.sln -c Release -r linux-x64 --self-contained
Write-Host "Syncing compiled layers to $TargetIp..." -ForegroundColor Cyan
sftp_sync.py --host $TargetIp --dir /opt/ctos/services
Write-Host "Restarting docker containers..." -ForegroundColor Cyan
ssh root@$TargetIp "cd /opt/ctos && docker compose up -d --build"
Write-Host "Executing migration suites..." -ForegroundColor Green
ssh root@$TargetIp "docker exec ctos-postgresql run-migrations.py"
Write-Host "DEPLOYMENT COMPLETE." -ForegroundColor Green // REMOTE_DEPLOY.SH (LINUX SHELL DEPLOYMENT)
BASH
#!/bin/bash
# remote_deploy.sh - Run on target host VM
set -e
echo "========== ctOS DEPLOYMENT DAEMON =========="
echo "Stopping active microservices..."
docker compose stop feed-ingestion intelligence-pipeline signalr-gateway
echo "Pruning expired docker cache buffers..."
docker builder prune -af --filter "until=24h"
echo "Rebuilding containers with memory tuning..."
docker compose -f docker-compose.yml -f docker-compose.infra.yml up -d --build
echo "Validating node heartbeat status..."
sleep 5
docker compose ps
docker logs ctos-rabbitmq | grep "Server startup complete"
echo "STATUS: NOMINAL"