Skip to content

Latest commit

 

History

History
524 lines (397 loc) · 13.2 KB

File metadata and controls

524 lines (397 loc) · 13.2 KB
SteerDock Logo

🐳 Modern Docker management platform with clean UI and powerful features

License Docker Go React Nginx MySQL PostgreSQL MongoDB Redis JWT OAuth Test Coverage

English | 简体中文 | 繁體中文 | Español | Français | Deutsch | 日本語 | Português | Русский | 한국어 | العربية | हिन्दी

📸 Screenshots

SteerDock Dashboard - Dark Theme

Docker Dashboard with real-time monitoring (Dark Theme)

SteerDock Monitoring - Light Theme

Real-time resource monitoring and container status (Light Theme)

✨ Features

🔐 Security & Authentication

  • JWT Authentication with 24h expiration
  • Role-Based Access Control (Super Admin / Admin / Manager / User / ReadOnly)
  • Password encryption (SHA-256)
  • Rate limiting and security headers
  • Complete audit logging
  • OAuth 2.0 support (Google, GitHub)

🗄️ Multi-Database Support

  • MySQL 8.0+ (Default)
  • PostgreSQL 15+
  • MongoDB 5.0+
  • Automatic schema migration
  • Connection pooling

🐳 Docker Management

  • Containers: Start, stop, restart, remove, create, inspect
  • Images: Pull, remove, inspect, search registries
  • Networks: Create, remove, connect/disconnect containers
  • Volumes: Create, remove, inspect, prune
  • Terminal: Real-time shell access with xterm.js
  • Logs: Real-time container logs streaming
  • Stats: Live resource usage monitoring (CPU, Memory, Network, I/O)

🌐 Multi-Host Support

  • Manage multiple Docker hosts
  • Local and remote Docker daemons
  • SSH and TCP connections
  • Quick host switching

🎨 Modern UI

  • Dark/Light theme
  • Responsive design
  • Multi-language support (10+ languages)
  • Keyboard shortcuts
  • Real-time updates

🚀 Quick Start

The fastest way to get SteerDock running:

# 1. Generate secure passwords and configuration
./generate-passwords.sh  # Linux/macOS
# or
.\generate-passwords.ps1  # Windows

# 2. Start all services with Docker Compose
docker compose up -d

# 3. Wait for services to start (about 30 seconds)
docker compose logs -f steerdock

# 4. Access SteerDock
# Open: http://localhost:5151

Default Login:

  • Username: superadmin
  • Password: superadmin123

⚠️ Change password after first login!


Option 1: Development Mode (Recommended for development)

# Linux/macOS
./start-dev.sh

# Windows
.\start-dev.ps1

Access:

Option 2: Production Mode

# Linux/macOS
./start-prod.sh

# Windows
.\start-prod.ps1

Access:

Option 3: Desktop Application (Windows)

# Windows only
.\win-desktop.ps1

This creates a standalone desktop application with:

  • Backend service running in background
  • Desktop GUI application (SteerDock-frontend.exe)
  • Access: Desktop application window

Option 4: Docker Compose (Recommended)

# 1. Generate configuration and passwords
./generate-passwords.sh  # Linux/macOS
# or
.\generate-passwords.ps1  # Windows

# 2. Start all services (MySQL + Redis + SteerDock)
docker compose up -d

# 3. Check service status
docker compose ps

# 4. View logs
docker compose logs -f steerdock

# 5. Access application
# Frontend: http://localhost:5151 (served by backend)
# Backend API: http://localhost:8383/api/v1

Services included:

  • MySQL database (port 3306)
  • Redis cache (port 6379)
  • SteerDock application (port 8383)

Important: Always use docker compose up -d to start all services together. Do not run individual containers with docker run.

Default Login:

  • Username: superadmin
  • Password: superadmin123

⚠️ Change password after first login!

� Manual Build

Build from Source

# 1. Build frontend
cd frontend
npm install
npm run build

# 2. Build backend (creates single binary)
cd ../backend
go mod tidy
go build -o steerdock .

# 3. Install the database and cache
cd .. && ./install-database.sh

# 4. Run backend
cd ./backend && ./steerdock  # Linux/macOS
# or: 
cd ./backend && steerdock.exe  # Windows

# 5. Run frontend (in another terminal)
cd ./frontend && npm run preview -- --host 0.0.0.0 --port 5151

Build Docker Image

Quick Build

# Use Docker Compose (Recommended)
docker compose up -d

Advanced Docker Build

# Build with custom tag and build args
docker build \
  --tag steerdock:v1.0.0 \
  --tag steerdock:latest \
  --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
  --build-arg VERSION=v1.0.0 \
  .

# Build for multiple platforms (requires buildx)
docker buildx build \
  --platform linux/amd64,linux/arm64 \
  --tag steerdock:latest \
  --push \
  .

# Build with specific Dockerfile
docker build -f Dockerfile -t steerdock:custom .

Container Configuration

Important: Use Docker Compose instead of individual containers for proper database connectivity.

# Generate configuration first
./generate-passwords.sh  # Linux/macOS
# or
.\generate-passwords.ps1  # Windows

# Start all services with Docker Compose
docker compose up -d

# For production deployment with custom configuration
docker compose -f docker-compose.prod.yml up -d

Why Docker Compose is required:

  • Automatic service networking (mysql, redis, steerdock)
  • Proper environment variable configuration
  • Health checks and service dependencies
  • Volume management for data persistence

Multi-Stage Build Details

The Dockerfile uses a 3-stage build process:

  1. Frontend Stage: Builds React app with Node.js

    FROM node:20-alpine AS frontend-builder
    # Builds optimized production frontend
  2. Backend Stage: Compiles Go binary

    FROM golang:1.24-alpine AS backend-builder  
    # Creates optimized static binary
  3. Final Stage: Minimal Alpine image with both frontend and backend

    FROM alpine:3.19
    # Runtime dependencies, backend serves frontend files, ~50MB final image

Container Health Check

# Check container health
docker ps --filter name=steerdock
docker logs steerdock
docker exec steerdock curl -f http://localhost:8383/health/live

# View container stats
docker stats steerdock

Using Makefile

# Build everything
make build

# Build and run with Docker
make docker-build
make docker-run

# Development mode
make dev

# Production mode  
make prod

📋 Requirements

  • Docker: 20.10+ and Docker Compose
  • System: Linux/Windows/macOS with 2GB+ RAM

For development:

  • Node.js: 20+
  • Go: 1.24+
  • Database: MySQL 8.0+ (default) / PostgreSQL 15+ / MongoDB 5.0+

🛠️ Tech Stack

Backend

  • Go 1.24+ with Gin framework
  • GORM for database operations
  • JWT authentication
  • WebSocket for real-time updates

Frontend

  • React 18+ with TypeScript
  • Vite build tool
  • Tailwind CSS
  • React Query for state management
  • xterm.js for terminal

👤 Default Users

👑 Super Admin: superadmin / superadmin123
🛡️ Admin: admin / admin123
👨‍💼 Manager: manager / manager123
👤 User: user / user123
👁️ ReadOnly: readonly / readonly123

⚠️ Change all default passwords after first login!

📖 Documentation

🔧 Configuration

All configuration is in .env file (auto-generated by password generator):

# Frontend
FRONTEND_PORT=5151
BASE_URL=http://localhost:8383

# Database (MySQL example - default)
MYSQL_USER=steerdock
MYSQL_PASSWORD=<auto-generated>
MYSQL_DATABASE=steerdock
MYSQL_HOST=mysql  # Docker service name
MYSQL_PORT=3306

# Security
JWT_SECRET=<auto-generated>
ALLOWED_ORIGINS=http://localhost:8383,http://localhost:5151

# Cache (Optional)
REDIS_HOST=redis  # Docker service name
REDIS_PORT=6379
REDIS_PASSWORD=<auto-generated>

🐞 Troubleshooting

Cannot connect to Docker

# Check Docker is running
docker ps

# Check Docker socket permissions (Linux)
ls -l /var/run/docker.sock
sudo chmod 666 /var/run/docker.sock  # If needed

Database connection failed

# Check if you're using Docker Compose (IMPORTANT!)
docker compose ps

# Should show 3 services: mysql, redis, steerdock
# If not, start with Docker Compose:
docker compose up -d

# Check database container
docker compose logs mysql

# Restart all services
docker compose restart

Cannot login

# Check backend is running
curl http://localhost:8383/health/live

# View backend logs
docker compose logs steerdock

# Check database initialization
docker compose exec mysql mysql -u steerdock -p steerdock -e "SELECT username FROM users;"

Port already in use

# Stop all services
docker compose down

# Or manually kill processes
# Linux/macOS
lsof -ti:8383 | xargs kill -9
lsof -ti:5432 | xargs kill -9
lsof -ti:6379 | xargs kill -9

# Windows
netstat -ano | findstr :8383
taskkill /PID <PID> /F

Common mistakes

# ❌ WRONG: Running single container without database
docker run steerdock:latest

# ✅ CORRECT: Using Docker Compose with all services
docker compose up -d

# ❌ WRONG: Missing .env file
docker compose up -d  # without running generate-passwords first

# ✅ CORRECT: Generate config first
./generate-passwords.sh && docker compose up -d

# ❌ WRONG: Using localhost for database in Docker
MYSQL_HOST=localhost  # Won't work in Docker

# ✅ CORRECT: Using Docker service names
MYSQL_HOST=mysql   # Docker Compose service name

🏗️ Project Structure

steerdock/
├── backend/             # Go backend application
│   ├── config/          # Configuration
│   ├── handlers/        # HTTP handlers
│   ├── middleware/      # Middleware
│   ├── models/          # Database models
│   ├── routes/          # API routes
│   └── main.go          # Entry point
├── frontend/            # React frontend
│   ├── src/
│   │   ├── components/  # React components
│   │   ├── pages/       # Page components
│   │   ├── hooks/       # Custom hooks
│   │   └── config/      # Configuration
│   └── package.json
├── sql/                 # Database init scripts
├── docs/                # Documentation
├── docker-compose.yml   # Docker Compose config
└── .env                 # Environment variables

🔒 Security Best Practices

  1. Change Default Passwords: Immediately after installation
  2. Use Strong Passwords: Follow password policy requirements
  3. Enable HTTPS: Use SSL/TLS certificates in production
  4. Regular Updates: Keep SteerDock and dependencies updated
  5. Audit Logs: Regularly review audit logs
  6. Backup: Regular encrypted backups
  7. Network Isolation: Use firewalls and network segmentation
  8. Least Privilege: Grant minimum required permissions

See SECURITY.md for detailed security guidelines.

🤝 Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Related Projects

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

📧 Support

🙏 Acknowledgments

  • Docker - Container platform
  • Go - Backend language
  • React - Frontend framework
  • Gin - Web framework
  • GORM - ORM library
  • xterm.js - Terminal emulator

Made with ❤️ by the SteerDock team