Welcome to the AstroML Docker documentation. This comprehensive guide covers all aspects of using Docker with AstroML.
- Docker Quick Reference - Start here! Quick commands and common tasks
- Full Docker Setup Guide - Complete setup instructions and service descriptions
- Environment Configuration Guide - Environment variables, templates, and best practices
- .env.example - Template for environment variables
- Production Deployment Guide - Complete production deployment checklist
- Production Compose Override - Production-specific configurations
- Main docker-compose.yml - Main service definitions
- docker-start.sh - Helper script for managing services
- docker-health-check.sh - Health verification script
- docker-backup.sh - Backup and restore script
- Troubleshooting Guide - Common issues and solutions
- Docker Entrypoint Scripts - Container initialization scripts
- Install Docker and Docker Compose (see Prerequisites section below)
- Read Docker Quick Reference
- Run
./scripts/docker-start.sh coreto start core services - Visit http://localhost:8000 for the API
- Copy
.env.exampleto.env - Run
./scripts/docker-start.sh dev - Access Jupyter Lab at http://localhost:8888
- See Environment Configuration Guide for options
- CPU Training:
./scripts/docker-start.sh training-cpu - GPU Training:
./scripts/docker-start.sh training-gpu - Monitor at http://localhost:6006 (TensorBoard)
- Review Production Deployment Guide
- Create
.env.prodfrom.env.example - Run
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d - Execute health checks:
./scripts/docker-health-check.sh
- Prometheus: http://localhost:9090
- Grafana: http://localhost:3000 (admin/admin)
- Run
docker statsfor real-time resource usage
- Backup:
./scripts/docker-backup.sh ./backups - Restore: See Troubleshooting Guide
- Check Troubleshooting Guide
- Run health checks:
./scripts/docker-health-check.sh - View logs:
docker-compose logs -f <service>
┌─────────────────────────────────────────┐
│ AstroML Application │
├─────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Ingestion │ │ Training │ │
│ │ Container │ │ Container │ │
│ └──────────────┘ └──────────────┘ │
│ ↓ ↓ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ PostgreSQL │ │ Redis │ │
│ │ Container │ │ Container │ │
│ └──────────────┘ └──────────────┘ │
│ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Prometheus │ │ Grafana │ │
│ │ Container │ │ Container │ │
│ └──────────────┘ └──────────────┘ │
│ │
└─────────────────────────────────────────┘
Docker Network (astroml-network)
| Service | Purpose | Port | Docker Target |
|---|---|---|---|
| PostgreSQL | Data storage | 5432 | - |
| Redis | Caching & jobs | 6379 | - |
| Ingestion | Data ingestion | 8000 | ingestion |
| Streaming | Real-time streaming | 8001 | ingestion |
| Training (CPU) | ML training | 6007 | training-cpu |
| Training (GPU) | ML training w/ GPU | 6006 | training |
| Development | Dev environment | 8002 | development |
| Production | Production service | 8000 | production |
| Prometheus | Metrics | 9090 | - |
| Grafana | Visualization | 3000 | - |
Minimum:
- 4GB RAM
- 2 CPU cores
- 20GB disk space
- Docker 20.10+
- Docker Compose 2.0+
Recommended:
- 8GB+ RAM
- 4+ CPU cores
- 50GB+ disk space
- Docker 20.10+
- Docker Compose 2.0+
For GPU Training:
- NVIDIA GPU
- NVIDIA Docker runtime
- CUDA 12.1+
Ubuntu/Debian:
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER
newgrp dockermacOS:
brew install --cask dockerWindows: Download Docker Desktop from https://www.docker.com/products/docker-desktop
Usually included with Docker Desktop. For Linux, if needed:
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-composeVerify installation:
docker --version
docker-compose --versiondistribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update && sudo apt-get install -y nvidia-docker2
sudo systemctl restart dockerVerify NVIDIA Docker:
docker run --rm --gpus all nvidia/cuda:12.1-runtime-ubuntu22.04 nvidia-smi# 1. Clone repository
git clone https://github.com/stellar/astroml.git
cd astroml
# 2. Copy environment template
cp .env.example .env
# 3. Start services
docker-compose up -d postgres redis ingestion
# 4. Check status
docker-compose ps
# 5. Test services
curl http://localhost:8000/health# Core infrastructure only
./scripts/docker-start.sh core
# Development environment
./scripts/docker-start.sh dev
# Data ingestion pipeline
./scripts/docker-start.sh ingestion
# ML training
./scripts/docker-start.sh training-cpu # CPU only
./scripts/docker-start.sh training-gpu # GPU support
# Full monitoring stack
./scripts/docker-start.sh monitoring
# Production deployment
./scripts/docker-start.sh production
# Everything
./scripts/docker-start.sh all# API
curl http://localhost:8000
# Jupyter Lab (dev environment)
open http://localhost:8888
# Prometheus (metrics)
open http://localhost:9090
# Grafana (dashboards)
open http://localhost:3000 # admin / admin
# PostgreSQL
psql -h localhost -U astroml -d astroml
# Redis CLI
redis-cli -h localhost# View status
./scripts/docker-start.sh status
# View logs
./scripts/docker-start.sh logs [service]
# Rebuild service
./scripts/docker-start.sh rebuild [service]
# Stop services
./scripts/docker-start.sh stop
# Stop and remove everything
./scripts/docker-start.sh stop-allSee Environment Configuration Guide for:
- Complete list of environment variables
- Configuration templates for different scenarios
- Secrets management best practices
- Validation procedures
See Troubleshooting Guide for solutions to:
- Build issues
- Container startup problems
- Networking errors
- Database connection issues
- Performance problems
- Memory and disk issues
Edit Dockerfile to:
- Add additional system dependencies
- Install additional Python packages
- Modify build stages
- Change base images
docker buildx build --platform linux/amd64,linux/arm64 -t astroml:latest .docker login registry.example.com
docker build -t registry.example.com/astroml:latest .
docker push registry.example.com/astroml:latestFor clustering:
docker swarm init
docker stack deploy -c docker-compose.prod.yml astromlSee Kubernetes setup for:
- Deployments
- Services
- StatefulSets
- ConfigMaps
- Secrets
See CONTRIBUTING.md for guidelines on:
- Reporting Docker-related issues
- Contributing Docker improvements
- Testing Docker configurations
AstroML is licensed under the Apache License 2.0. See LICENSE for details.