Creates optimized Docker configurations with multi-stage builds, security hardening, and compose files for all environments.
You are a DevOps engineer who creates optimized container configurations. Create Docker configuration for this application.
Application type: [WEB APP / API / WORKER / DATABASE / OTHER]
Language/Framework: [TECH STACK]
Dependencies: [SYSTEM AND APP DEPENDENCIES]
Environments: [DEV / STAGING / PROD]
Orchestration: [DOCKER COMPOSE / KUBERNETES / ECS / OTHER]
Security requirements: [COMPLIANCE NEEDS]
Provide:
**Dockerfile**
```dockerfile
# Multi-stage build optimized for production
# Stage 1: Build
FROM node:20-alpine AS builder
# Complete Dockerfile with:
# - Security hardening
# - Layer optimization
# - Proper caching
# - Non-root user
# - Health checks
# - Labels
```
**Dockerfile Explanation**
- Why each instruction
- Layer optimization rationale
- Security considerations
**.dockerignore**
```
# Patterns to exclude
```
**docker-compose.yml** (Development)
```yaml
version: '3.8'
services:
app:
# Complete service definition
# Supporting services
```
**docker-compose.prod.yml** (Production overrides)
```yaml
# Production-specific configuration
```
**Environment Configuration**
- .env.example template
- Secrets management approach
- Environment variable documentation
**Build Commands**
```bash
# Development
# Production
# Multi-platform
```
**Image Optimization**
- Target image size
- Layer analysis
- Base image selection rationale
**Security Checklist**
- [ ] Non-root user
- [ ] Read-only filesystem where possible
- [ ] No secrets in image
- [ ] Minimal base image
- [ ] Security scanning
**CI/CD Integration**
- Build pipeline snippet
- Caching strategy
- Registry push
**Health Checks and Monitoring**
- Healthcheck configuration
- Logging setup
- Resource limitsYou are a DevOps engineer who creates optimized container configurations. Create Docker configuration for this application.
Application type: [WEB APP / API / WORKER / DATABASE / OTHER]
Language/Framework: [TECH STACK]
Dependencies: [SYSTEM AND APP DEPENDENCIES]
Environments: [DEV / STAGING / PROD]
Orchestration: [DOCKER COMPOSE / KUBERNETES / ECS / OTHER]
Security requirements: [COMPLIANCE NEEDS]
Provide:
**Dockerfile**
```dockerfile
# Multi-stage build optimized for production
# Stage 1: Build
FROM node:20-alpine AS builder
# Complete Dockerfile with:
# - Security hardening
# - Layer optimization
# - Proper caching
# - Non-root user
# - Health checks
# - Labels
```
**Dockerfile Explanation**
- Why each instruction
- Layer optimization rationale
- Security considerations
**.dockerignore**
```
# Patterns to exclude
```
**docker-compose.yml** (Development)
```yaml
version: '3.8'
services:
app:
# Complete service definition
# Supporting services
```
**docker-compose.prod.yml** (Production overrides)
```yaml
# Production-specific configuration
```
**Environment Configuration**
- .env.example template
- Secrets management approach
- Environment variable documentation
**Build Commands**
```bash
# Development
# Production
# Multi-platform
```
**Image Optimization**
- Target image size
- Layer analysis
- Base image selection rationale
**Security Checklist**
- [ ] Non-root user
- [ ] Read-only filesystem where possible
- [ ] No secrets in image
- [ ] Minimal base image
- [ ] Security scanning
**CI/CD Integration**
- Build pipeline snippet
- Caching strategy
- Registry push
**Health Checks and Monitoring**
- Healthcheck configuration
- Logging setup
- Resource limitsThis prompt is released under CC0 (Public Domain). You are free to use it for any purpose without attribution.
Explore similar prompts based on category and tags
Creates complete CI/CD pipeline configurations with testing, security scanning, multi-environment deployment, and monitoring.
Designs complete Git workflows with branching strategies, commit conventions, PR processes, and automation.
Creates comprehensive Architecture Decision Records with options analysis, decision matrices, and consequence documentation.
Conducts thorough code reviews covering security, performance, maintainability, and best practices with specific fix suggestions.