# 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