Some checks reported errors
continuous-integration/drone/push Build encountered an error
🐳 DOCKER DEPLOYMENT INFRASTRUCTURE: ## New Docker Files: - deployment/docker/Dockerfile.optimized - Multi-stage optimized builds - docker-compose.prod.yml - Production cluster deployment - docker-compose.dev.yml - Development environment - deploy-docker.sh - One-command deployment script - Makefile.docker - Advanced management commands - .env.docker - Environment configuration template - DOCKER_DEPLOYMENT.md - Complete deployment guide ## Container Images: - pyguardian:controller - Cluster management (200MB) - pyguardian:agent - Security monitoring (180MB) - pyguardian:standalone - All-in-one deployment (220MB) - pyguardian:development - Dev tools + Jupyter (350MB) ## Deployment Modes: - Standalone: Single container with all features - Cluster: Controller + scalable agents with JWT auth - Production: Enterprise deployment with monitoring - Development: Hot reload + debugging tools ## Key Features: ✅ Multi-stage Docker builds for optimization ✅ Privileged containers for system monitoring ✅ Host networking for firewall integration ✅ Volume persistence for data/logs/config ✅ Health checks and auto-restart ✅ Prometheus monitoring integration ✅ SSL/TLS support with custom certificates ✅ Automated backup and restore ✅ CI/CD ready builds ## Quick Commands: ./deploy-docker.sh standalone # Quick start ./deploy-docker.sh cluster --scale 3 # Production cluster make -f Makefile.docker prod-up # Advanced management make -f Makefile.docker health # Health checks Ready for enterprise Docker deployment! 🚀
119 lines
2.6 KiB
YAML
119 lines
2.6 KiB
YAML
# PyGuardian Development Docker Compose
|
|
# For development and testing with hot reload and debug tools
|
|
|
|
version: '3.8'
|
|
|
|
services:
|
|
# Development PyGuardian with all tools
|
|
pyguardian-dev:
|
|
build:
|
|
context: .
|
|
dockerfile: deployment/docker/Dockerfile.optimized
|
|
target: development
|
|
container_name: pyguardian-dev
|
|
hostname: pyguardian-dev
|
|
restart: unless-stopped
|
|
privileged: true
|
|
|
|
ports:
|
|
- "8443:8443" # API
|
|
- "8888:8888" # Jupyter Lab
|
|
- "8080:8080" # Additional dev port
|
|
|
|
volumes:
|
|
# Source code for hot reload
|
|
- ./src:/opt/pyguardian/src
|
|
- ./config:/opt/pyguardian/config
|
|
- ./tests:/opt/pyguardian/tests
|
|
- ./main.py:/opt/pyguardian/main.py
|
|
|
|
# Development data
|
|
- dev_data:/opt/pyguardian/data
|
|
- dev_logs:/opt/pyguardian/logs
|
|
- ./logs:/opt/pyguardian/logs/host
|
|
|
|
# System access for testing
|
|
- /var/log:/var/log:ro
|
|
- /proc:/host/proc:ro
|
|
- /sys:/host/sys:ro
|
|
|
|
environment:
|
|
- PYGUARDIAN_MODE=development
|
|
- PYGUARDIAN_LOG_LEVEL=DEBUG
|
|
- PYGUARDIAN_DEBUG=true
|
|
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
|
|
- START_JUPYTER=true
|
|
- PYTHONUNBUFFERED=1
|
|
- PYTHONDONTWRITEBYTECODE=1
|
|
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8443/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 60s
|
|
|
|
labels:
|
|
- "pyguardian.service=development"
|
|
- "pyguardian.version=2.1.0"
|
|
|
|
# Test database for development
|
|
pyguardian-testdb:
|
|
image: postgres:15-alpine
|
|
container_name: pyguardian-testdb
|
|
restart: unless-stopped
|
|
|
|
environment:
|
|
- POSTGRES_DB=pyguardian_test
|
|
- POSTGRES_USER=pyguardian
|
|
- POSTGRES_PASSWORD=test_password
|
|
|
|
volumes:
|
|
- testdb_data:/var/lib/postgresql/data
|
|
|
|
ports:
|
|
- "5432:5432"
|
|
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U pyguardian"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
labels:
|
|
- "pyguardian.service=testdb"
|
|
|
|
# Redis for caching and sessions
|
|
pyguardian-redis:
|
|
image: redis:7-alpine
|
|
container_name: pyguardian-redis
|
|
restart: unless-stopped
|
|
|
|
ports:
|
|
- "6379:6379"
|
|
|
|
volumes:
|
|
- redis_data:/data
|
|
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 3s
|
|
retries: 3
|
|
|
|
labels:
|
|
- "pyguardian.service=redis"
|
|
|
|
volumes:
|
|
dev_data:
|
|
driver: local
|
|
dev_logs:
|
|
driver: local
|
|
testdb_data:
|
|
driver: local
|
|
redis_data:
|
|
driver: local
|
|
|
|
networks:
|
|
default:
|
|
name: pyguardian-dev |