Some checks failed
Deploy / deploy (push) Failing after 0s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
RedUnits Control Panel
A beautiful, lightweight service management dashboard for monitoring Docker containers and system resources.
Features
- Real-time service monitoring
- Docker container status and metrics
- System resource usage (CPU, Memory, Disk)
- Auto-refresh every 30 seconds
- Responsive dark theme design
- Minimal dependencies (FastAPI + Alpine.js)
Project Structure
~/repo/redunits/www/
├── app/
│ ├── __init__.py
│ ├── main.py # FastAPI application
│ └── docker_monitor.py # Docker monitoring module
├── static/
│ ├── css/
│ │ └── style.css # Styles
│ └── js/
│ └── app.js # Alpine.js frontend logic
├── templates/
│ └── index.html # Main dashboard template
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
└── README.md
Installation
Prerequisites
- Docker and Docker Compose installed
- Python 3.11+ (for local development)
Quick Start with Docker
- Build and run the container:
cd ~/repo/redunits/www
docker-compose up -d --build
- Access the dashboard:
http://localhost:8000
Local Development
- Create virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Run the application:
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
Deployment on VPS
1. Copy files to VPS:
rsync -avz ~/repo/redunits/www/ vps:/opt/redunits/www/
2. SSH into VPS and deploy:
ssh vps
cd /opt/redunits/www
sudo docker-compose up -d --build
3. Add to Caddy configuration:
Edit /etc/caddy/Caddyfile:
www.redunits.net, redunits.net {
encode zstd gzip
reverse_proxy 127.0.0.1:8000
}
Reload Caddy:
sudo systemctl reload caddy
API Endpoints
GET /- Main dashboard pageGET /api/services- Get all services with statusGET /api/system- Get system statisticsGET /api/health- Health check endpoint
Configuration
Adding New Services
Edit app/main.py and add to the SERVICES list:
{
"id": "service-id",
"name": "Service Name",
"icon": "🔧",
"description": "Service description",
"url": "https://service.domain.com",
"container_name": "docker-container-name",
"port": 8080
}
Security Notes
- The application requires read-only access to Docker socket
- Run with non-root user inside container
- Use reverse proxy (Caddy) for HTTPS in production
- Consider adding authentication for production use
Monitoring
The dashboard automatically monitors:
- Container status (running/stopped)
- Container CPU usage
- Container memory usage
- Container uptime
- System CPU usage
- System memory usage
- System disk usage
- Total and running container count
Tech Stack
- Backend: FastAPI (Python)
- Frontend: Alpine.js + Vanilla CSS
- Monitoring: Docker SDK for Python + psutil
- Container: Docker with multi-stage build
Development
Running tests:
# TODO: Add tests
pytest
Code formatting:
black app/
License
MIT
Author
RedUnits Team
Description
Languages
Python
35.2%
CSS
24.8%
HTML
23.3%
JavaScript
15%
Dockerfile
1.7%