{{Project Name}} - Docker Configuration Template
Generated with JAEGIS Enhanced Validation & Research
[[LLM: VALIDATION CHECKPOINT - Review shared context from infrastructure architecture and validate all container requirements. Integrate web research findings for current Docker security patterns and best practices.]]
Executive Summary
[[LLM: RESEARCH INTEGRATION - Include current containerization best practices and validated Docker configurations. All container settings must be researched for security, performance, and current standards.]]
Container Configuration
[[LLM: VALIDATION CHECKPOINT - All Docker configurations must be validated for security, performance optimization, and current best practices. Include research-backed container hardening techniques.]] Docker Version: 24.0+ compatible Security Standards: CIS Docker Benchmark, NIST Container Security
Multi-Stage Dockerfile Template
๐ณ Production-Ready Dockerfile
# {application_name} Dockerfile
# Generated by Phoenix Agent on {current_date}
# Multi-stage build for optimized production deployment
# Build stage
FROM {base_build_image} AS builder
# Metadata
LABEL maintainer="{maintainer_email}"
LABEL version="{application_version}"
LABEL description="{application_description}"
LABEL build-date="{current_date}"
LABEL phoenix-agent="true"
# Build arguments
ARG BUILD_DATE={current_date}
ARG VERSION={application_version}
ARG VCS_REF={git_commit_hash}
# Set working directory
WORKDIR /app
# Install build dependencies
{build_dependencies_install}
# Copy dependency files first for better caching
COPY {dependency_files} ./
# Install dependencies
{dependency_install_command}
# Copy source code
COPY {source_files} ./
# Build application
{build_command}
# Run tests (optional, can be disabled with --target runtime)
{test_command}
# Production stage
FROM {base_runtime_image} AS runtime
# Security: Create non-root user
RUN groupadd -r {app_user} && useradd -r -g {app_user} {app_user}
# Install runtime dependencies only
{runtime_dependencies_install}
# Set working directory
WORKDIR /app
# Copy built application from builder stage
COPY --from=builder --chown={app_user}:{app_user} /app/{build_output} ./
# Copy configuration files
COPY --chown={app_user}:{app_user} {config_files} ./config/
# Create necessary directories
RUN mkdir -p /app/logs /app/tmp && \
chown -R {app_user}:{app_user} /app/logs /app/tmp
# Security: Remove unnecessary packages and clean up
{cleanup_commands}
# Security: Set file permissions
RUN chmod -R 755 /app && \
chmod -R 644 /app/config && \
chmod +x /app/{executable_name}
# Switch to non-root user
USER {app_user}
# Expose port
EXPOSE {application_port}
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD {health_check_command} || exit 1
# Environment variables
ENV NODE_ENV={environment} \
PORT={application_port} \
LOG_LEVEL={log_level} \
BUILD_DATE=${BUILD_DATE} \
VERSION=${VERSION} \
VCS_REF=${VCS_REF}
# Volume for persistent data
VOLUME ["/app/data", "/app/logs"]
# Start application
CMD ["{start_command}"]Docker Compose Configuration
๐ผ Development Environment (docker-compose.yml)
๐ Production Environment (docker-compose.prod.yml)
Kubernetes Deployment Templates
โธ๏ธ Kubernetes Deployment Manifest
Template Variables
๐ Configuration Variables
This Docker configuration template provides comprehensive containerization setup with security best practices, multi-stage builds, health checks, and production-ready orchestration configurations.
Last updated