Start a fresh conversation. Replace the highlighted placeholders.
Use adding-docker to Dockerize [application or repository] for production, adding a runtime-appropriate multi-stage Dockerfile, .dockerignore, and docker-compose.yml if the app has dependencies, with a health check for production deployment.
Required inputs
[application or repository]
User-approved starter prompt based on a pinned source version; check current skill requirements before running. Task evidence ↗
SKILL.md
name: adding-dockerdescription: Dockerize an application with a production-ready Dockerfile, docker-compose setup, and .dockerignore.
Add Docker
Use this skill when the user asks to dockerize, containerize, or add Docker support to an application.
Steps
Detect the runtime — inspect package.json, requirements.txt, go.mod, Cargo.toml, etc. to determine the language and runtime.
Create a multi-stage Dockerfile
For Node.js (example):
FROM node:20-alpine AS base
FROM base AS deps
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --omit=dev
FROM base AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
COPY --from=deps /app/node_modules ./node_modules
COPY --from=build /app/.next ./.next
COPY --from=build /app/public ./public
COPY --from=build /app/package.json ./
EXPOSE 3000
CMD ["npm", "start"]
Adapt for the detected framework — adjust the build output directory, entry command, and base image.
Create .dockerignore
node_modules
.next
.git
.env*
*.md
Create docker-compose.yml (if the app has dependencies like a database or Redis):