docker-containerization

Docker & Containerization

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "docker-containerization" with this command: npx skills add kinhluan/skills/kinhluan-skills-docker-containerization

Docker & Containerization

Best practices for Docker and containerized applications.

When to Use

  • Containerizing applications

  • Writing or optimizing Dockerfiles

  • Setting up development or production environments

Dockerfile Best Practices

Multi-Stage Builds

Build stage

FROM node:20-alpine AS builder WORKDIR /app COPY package*.json ./ RUN npm ci COPY . . RUN npm run build

Production stage

FROM node:20-alpine WORKDIR /app COPY --from=builder /app/dist ./dist COPY --from=builder /app/node_modules ./node_modules EXPOSE 3000 CMD ["node", "dist/index.js"]

Security Practices

Use specific versions, not latest

FROM python:3.11-slim

Create non-root user

RUN useradd -m appuser USER appuser

Minimize layers and cache

RUN apt-get update && apt-get install -y --no-install-recommends
package
&& rm -rf /var/lib/apt/lists/*

.dockerignore

node_modules .git *.log .env .DS_Store

Docker Compose

version: '3.8' services: app: build: . ports: - "3000:3000" environment: - NODE_ENV=production depends_on: - db

db: image: postgres:15-alpine volumes: - pgdata:/var/lib/postgresql/data

volumes: pgdata:

Resources

  • Docker Docs

  • Dockerfile Best Practices

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

ddd-tactical

No summary provided by upstream source.

Repository SourceNeeds Review
General

ddd-patterns

No summary provided by upstream source.

Repository SourceNeeds Review
General

scheduling-algorithms

No summary provided by upstream source.

Repository SourceNeeds Review
General

ddd-core

No summary provided by upstream source.

Repository SourceNeeds Review