docker-ops

Solid

Dockerfile best practices, multi-stage builds, docker-compose, container networking, volume management, and image optimization.

AI & Automation 496 stars 41 forks Updated 1 months ago MIT

Install

View on GitHub

Quality Score: 86/100

Stars 20%
90
Recency 20%
75
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Docker Operations Practical patterns for building, running, and maintaining containers in production. ## Multi-Stage Builds Minimize final image size by separating build-time dependencies from runtime. ```dockerfile # Stage 1: Builder FROM node:20-alpine AS builder WORKDIR /app # Copy dependency manifests first (layer cache) COPY package*.json ./ RUN npm ci --only=production COPY tsconfig.json ./ COPY src/ ./src/ RUN npm run build # Stage 2: Runtime (no devDependencies, no source files) FROM node:20-alpine AS runtime WORKDIR /app # Security: run as non-root RUN addgroup -S appgroup && adduser -S appuser -G appgroup COPY --from=builder /app/node_modules ./node_modules COPY --from=builder /app/dist ./dist USER appuser EXPOSE 3000 CMD ["node", "dist/index.js"] ``` ```dockerfile # Python multi-stage example FROM python:3.12-slim AS builder WORKDIR /app RUN pip install --upgrade pip COPY requirements.txt . RUN pip install --prefix=/install -r requirements.txt FROM python:3.12-slim AS runtime WORKDIR /app COPY --from=builder /install /usr/local COPY src/ ./src/ RUN useradd -r -s /bin/false appuser USER appuser CMD ["python", "-m", "src.main"] ``` ## Docker Compose for Multi-Service Environments ```yaml # docker-compose.yml version: '3.9' services: api: build: context: . dockerfile: Dockerfile target: runtime ports: - "3000:3000" environment: - NODE_ENV=production - DATABASE_URL=postgresql://user:pass@postgres:5...

Details

Author
vibeeval
Repository
vibeeval/vibecosystem
Created
2 months ago
Last Updated
1 months ago
Language
C#
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category