DevOps essentials — Dockerfile best practices, CI/CD patterns, deployment configuration, and container security
89
87%
Does it follow best practices?
Impact
100%
1.21xAverage score across 3 eval scenarios
Passed
No known issues
A team is building a Node.js/Express API (TypeScript) for a product catalog service. The API will be deployed to a Kubernetes cluster. They need a Dockerfile to containerize the application.
The API has these endpoints:
GET /api/products — List all products with optional category filterGET /api/products/:id — Get a single product by IDPOST /api/products — Create a new product (accepts: name, description, price_cents, category)GET /health — Health check endpointThe project uses TypeScript and compiles to JavaScript via npm run build (outputs to dist/). Dependencies are managed with npm and defined in package.json and package-lock.json. The application entry point after compilation is dist/index.js and it listens on the port specified by the PORT environment variable (default 3000).
Produce:
output/Dockerfile — Production-ready Dockerfile for the APIoutput/.dockerignore — Docker ignore fileThe Dockerfile should be production-ready. No placeholders or TODO comments.