Skip to main content

docker-expert

Expert in Docker, docker-compose, Dockerfile patterns, and container orchestration for NestJS and Next.js applications. Use this skill when users need Docker setup, containerization, or docker-compose configuration.

소스 정보

저장소
shipshitdev/shipcode
최근 소스 활동
2026년 7월 10일 11:20
감지된 SKILL.md 언어
영어
스타
6
포크
0

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
2 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
docker-expert
description
Expert in Docker, docker-compose, Dockerfile patterns, and container orchestration for NestJS and Next.js applications. Use this skill when users need Docker setup, containerization, or docker-compose configuration.
metadata
{"version":"1.0.0","tags":"docker, containers, infrastructure"}
# Docker Expert ## When to Use - Dockerfile creation for NestJS/Next.js - docker-compose configuration - Container networking and volumes - Multi-stage builds optimization - Health checks and restart policies - MongoDB/Redis container setup ## Dockerfile Best Practices ### NestJS Multi-Stage Build ```dockerfile FROM node:20-alpine AS base WORKDIR /app FROM base AS deps COPY package*.json ./ RUN npm ci FROM base AS builder COPY --from=deps /app/node_modules ./node_modules COPY . . RUN npm run build FROM base AS runner ENV NODE_ENV=production COPY --from=builder /app/dist ./dist COPY --from=builder /app/node_modules ./node_modules EXPOSE 3001 CMD ["node", "dist/main.js"] ``` ### Next.js Dockerfile ```dockerfile FROM node:20-alpine AS base WORKDIR /app FROM base AS deps COPY package*.json ./ RUN npm ci FROM base AS builder COPY --from=deps /app/node_modules ./node_modules COPY . . RUN npm run build FROM base AS runner ENV NODE_ENV=production COPY --from=builder /app/.next ./.next COPY --from=builder /app/public ./public COPY --from=builder /app/node_modules ./node_modules COPY --from=builder /app/package.json ./package.json EXPOSE 3000 CMD ["npm", "start"] ``` ## Docker Compose Patterns ### Development Setup - Use volumes for live reload - Mount source code - Set restart: unless-stopped - Configure networks ### Production Setup - Use named volumes for persistence - Set restart policies - Configure health checks - Use secrets management ### MongoDB with Docker Compose ```yaml services: mongodb: image: mongo:7.0 container_name: mongodb restart: unless-stopped ports: - "27017:27017" environment: MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USERNAME} MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD} volumes: - mongodb_data:/data/db networks: - app-network command: mongod --auth ``` ## Health Checks ```yaml healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3001/health"] interval: 30s timeout: 10s retries: 3 start_period: 40s ``` ## Best Practices - Use multi-stage builds to reduce image size - Leverage layer caching - Use .dockerignore - Set appropriate restart policies - Use health checks for containers - Mount volumes for persistent data - Use networks for service isolation
GitHub에서 보기