Containerize and deploy applications to servers using Docker and Docker Compose. Supports multi-service orchestration, Dockerfile generation, compose file authoring, image building, container management, and production deployment best practices. Use when user asks to "dockerize", "containerize", "deploy with docker", "docker compose", "multi-service deployment", "container orchestration", or needs help with Dockerfile, docker-compose.yml, or server deployment.
Helps users containerize applications and deploy them to servers using Docker and Docker Compose, with support for multi-service orchestration.
IN SCOPE:
docker-compose.yml / compose.yml files with multi-service orchestrationOUT OF SCOPE:
Identify the tech stack by examining the project files:
package.json (Node.js), requirements.txt / pyproject.toml / Pipfile (Python), go.mod (Go), pom.xml / build.gradle (Java), Cargo.toml (Rust), composer.json (PHP), Gemfile (Ruby), *.csproj (C#/.NET)Dockerfile, docker-compose.yml, or .dockerignoreAsk clarifying questions if the following are unclear:
Follow these best practices when generating Dockerfiles:
Always use multi-stage builds for compiled languages and frontend assets to minimize image size.
# Example: Node.js multi-stage
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:20-alpine AS runtime
WORKDIR /app
ENV NODE_ENV=production
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
COPY package*.json ./
EXPOSE 3000
USER node
CMD ["node", "dist/index.js"]
latest), prefer -alpine or -slim variantsUSER directive; never run as root in production.dockerignore: Always generate a .dockerignore alongside the DockerfileHEALTHCHECK instruction when appropriateLABEL for maintainer, version, description metadataexec form for CMD (JSON array syntax) so the process receives signals properlyRUN commands with &&Refer to references/dockerfile-templates.md for ready-to-use Dockerfile templates for each supported stack.
Use Compose Specification (v3.8+ / compose spec) format.
# compose.yml (preferred filename per Compose Specification)