Docker Configuration
Create optimized Dockerfiles and Docker Compose configurations for your projects.
Prompt template
Create an optimized Docker configuration for the following project: **Project Details:** - Application type: [TYPE: web app, API, microservice, etc.] - Programming language/runtime: [LANGUAGE AND VERSION] - Framework: [FRAMEWORK] - Database: [DATABASE, if applicable] - Additional services: [CACHE, MESSAGE QUEUE, etc.] **Please create:** 1. **Dockerfile:** Multi-stage build with optimized image size - Use official base images - Implement layer caching strategies - Use a non-root user - Set meaningful health checks 2. **docker-compose.yml:** Complete Compose configuration - Service definitions with dependencies - Network configuration - Volume mounts for persistence - Environment variables with .env file 3. **.dockerignore:** Optimized ignore rules 4. **Security Notes:** Best practices for container security Optimize for minimal image size and fast build times.
Replace placeholders in [square brackets]: [TYPE: web app, API, microservice, etc.][LANGUAGE AND VERSION][FRAMEWORK][DATABASE, if applicable][CACHE, MESSAGE QUEUE, etc.]
How to use this template
Copy the prompt, replace the placeholders in square brackets with your details and paste it into the AI assistant of your choice. The more precise your details, the better the result.
Tips for better results
- Specify the exact runtime version and framework
- Mention whether it's for development or production
- Ask for Kubernetes-compatible configurations
- Request separate configs for dev and prod
Suitable open models
The selection names current open models as a starting point for your own tests. It is not a measurement for this template.
Keywords: #docker #containerization #devops #infrastructure