1 line
4.0 KiB
JSON
1 line
4.0 KiB
JSON
{"content": "---\nallowed-tools: Read, Write, Edit, Bash\nargument-hint: [application-type] | --node | --python | --java | --go | --multi-stage\ndescription: Containerize application with optimized Docker configuration, security, and multi-stage builds\n---\n\n# Application Containerization\n\nContainerize application for deployment: $ARGUMENTS\n\n## Current Application Analysis\n\n- Application type: @package.json or @setup.py or @go.mod or @pom.xml (detect runtime)\n- Existing Docker: @Dockerfile or @docker-compose.yml (if exists)\n- Dependencies: !`find . -name \"*requirements*.txt\" -o -name \"package*.json\" -o -name \"go.mod\" | head -3`\n- Port configuration: !`grep -r \"PORT\\|listen\\|bind\" src/ 2>/dev/null | head -3 || echo \"Port detection needed\"`\n- Build tools: @Makefile or build scripts detection\n\n## Task\n\nImplement production-ready containerization strategy:\n\n1. **Application Analysis and Containerization Strategy**\n - Analyze application architecture and runtime requirements\n - Identify application dependencies and external services\n - Determine optimal base image and runtime environment\n - Plan multi-stage build strategy for optimization\n - Assess security requirements and compliance needs\n\n2. **Dockerfile Creation and Optimization**\n - Create comprehensive Dockerfile with multi-stage builds\n - Select minimal base images (Alpine, distroless, or slim variants)\n - Configure proper layer caching and build optimization\n - Implement security best practices (non-root user, minimal attack surface)\n - Set up proper file permissions and ownership\n\n3. **Build Process Configuration**\n - Configure .dockerignore file to exclude unnecessary files\n - Set up build arguments and environment variables\n - Implement build-time dependency installation and cleanup\n - Configure application bundling and asset optimization\n - Set up proper build context and file structure\n\n4. **Runtime Configuration**\n - Configure application startup and health checks\n - Set up proper signal handling and graceful shutdown\n - Configure logging and output redirection\n - Set up environment-specific configuration management\n - Configure resource limits and performance tuning\n\n5. **Security Hardening**\n - Run application as non-root user with minimal privileges\n - Configure security scanning and vulnerability assessment\n - Implement secrets management and secure credential handling\n - Set up network security and firewall rules\n - Configure security policies and access controls\n\n6. **Docker Compose Configuration**\n - Create docker-compose.yml for local development\n - Configure service dependencies and networking\n - Set up volume mounting and data persistence\n - Configure environment variables and secrets\n - Set up development vs production configurations\n\n7. **Container Orchestration Preparation**\n - Prepare configurations for Kubernetes deployment\n - Create deployment manifests and service definitions\n - Configure ingress and load balancing\n - Set up persistent volumes and storage classes\n - Configure auto-scaling and resource management\n\n8. **Monitoring and Observability**\n - Configure application metrics and health endpoints\n - Set up logging aggregation and centralized logging\n - Configure distributed tracing and monitoring\n - Set up alerting and notification systems\n - Configure performance monitoring and profiling\n\n9. **CI/CD Integration**\n - Configure automated Docker image building\n - Set up image scanning and security validation\n - Configure image registry and artifact management\n - Set up automated deployment pipelines\n - Configure rollback and blue-green deployment strategies\n\n10. **Testing and Validation**\n - Test container builds and functionality\n - Validate security configurations and compliance\n - Test deployment in different environments\n - Validate performance and resource utilization\n - Test backup and disaster recovery procedures\n - Create documentation for container deployment and management"} |