Dockerfile Gen

Instantly generate optimized multi-stage Dockerfiles and docker-compose configs for any web project.

Install
cmdop skills install agensi-dockerfile-gen

Dockerfile Gen is a skill that analyzes a project repository and produces production-ready Docker configuration files without manual authoring. It scans the project structure to detect the framework in use — Node.js, Next.js, Python, Go, Rust, or Java — and uses that context to generate a Dockerfile tailored to the runtime’s conventions.

The generated Dockerfiles use multi-stage build patterns, such as a builder stage compiled down to a Scratch or Alpine final image, to keep production images small. The skill reads manifest files and .env files to extract environment variables, then outputs ARG placeholders and environment templates so nothing sensitive is hardcoded. Port definitions found in the source code are mapped to accurate EXPOSE statements and port settings.

Beyond the Dockerfile itself, the skill generates a docker-compose.yml that includes health checks and persistent volumes for any databases detected in the project. It also produces a .dockerignore file to keep the build context lean.

This skill is appropriate when an agent needs to containerize a recognized web project automatically, following practices such as non-root users, health checks, and minimal image layers. It is not a general-purpose infrastructure tool and does not cover Kubernetes manifests, Helm charts, or cloud-provider deployment configurations. No environment variables need to be configured to use it.

Use cases

  • Generate a multi-stage Dockerfile for a Next.js application with minimal final image size
  • Create a docker-compose.yml with health checks and volumes for a Python project that uses a database
  • Extract environment variable requirements from .env files into ARG placeholders automatically
  • Produce a .dockerignore file to reduce Docker build context for a Go project
  • Containerize a Rust binary using a Builder-to-Scratch multi-stage pattern
  • Scan source code port definitions and emit correct EXPOSE directives in the Dockerfile

When to use it

  • The project uses a supported framework: Node.js, Next.js, Python, Go, Rust, or Java
  • An agent needs to produce a first-pass Dockerfile without manual editing
  • The project needs a docker-compose.yml with database volumes and health checks generated automatically
  • Environment variable templating from existing manifest or .env files is required

When not to use it

  • The project uses a framework or runtime not in the supported list
  • Kubernetes manifests, Helm charts, or cloud-provider IaC are needed instead of Docker configs
  • Fine-grained manual control over every Dockerfile instruction is required from the start
  • The project has no repository structure for the skill to scan