Agent skill
container-expert
Docker, Docker Compose ve Nginx yapılandırması için uzman yetenek. Konteynerleştirme, reverse proxy, SSL sonlandırma ve üretim ortamı dağıtımı (production deployment) konularında kullanılır.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/container-expert-berkantyilmaz0-megastore
SKILL.md
🐳 Container Expert (Docker & Nginx)
Bu yetenek, uygulamaların konteynerleştirilmesi (Docker) ve sunulması (Nginx) konularında uzman rehberlik sağlar.
🎯 Ne Zaman Kullanılır?
- Kullanıcı "uygulamayı dockerize et" dediğinde.
- "Nginx reverse proxy ayarla" isteği geldiğinde.
docker-compose.ymlveyaDockerfileoluşturulması gerektiğinde.- Üretim ortamı (production) dağıtım konfigürasyonlarında.
🏗️ 1. Dockerfile Standartları
Her zaman Multi-Stage Build (Çok Aşamalı İnşa) kullanın. Bu, imaj boyutunu küçültür ve güvenliği artırır.
Node.js / Next.js İçin Örnek (Dockerfile)
# 1. Aşama: Bağımlılıklar
FROM node:18-alpine AS deps
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
# 2. Aşama: İnşa (Build)
FROM node:18-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build
# 3. Aşama: Çalıştırma (Runner)
FROM node:18-alpine AS runner
WORKDIR /app
ENV NODE_ENV production
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
EXPOSE 3000
CMD ["npm", "start"]
🐙 2. Docker Compose Şablonları
Servisleri ve veritabanlarını birleştirmek için kullanılır.
Standart Yığın (docker-compose.yml)
version: '3.8'
services:
app:
build: .
ports:
- "3000:3000"
environment:
- DATABASE_URL=postgresql://user:pass@db:5432/myapp
depends_on:
- db
db:
image: postgres:15-alpine
volumes:
- db_data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=user
- POSTGRES_PASSWORD=pass
- POSTGRES_DB=myapp
volumes:
db_data:
🌐 3. Nginx Yapılandırması
Uygulamanın önüne bir "Kapı Bekçisi" (Reverse Proxy) koymak için kullanılır.
Örnek nginx.conf
server {
listen 80;
server_name example.com;
# Gzip Sıkıştırma
gzip on;
gzip_types text/plain application/json text/css application/javascript;
location / {
proxy_pass http://app:3000; # Docker servis adı
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
🛡️ Güvenlik ve En İyi Pratikler
- Asla Root Kullanma: Dockerfile içinde
USER nodegibi root olmayan bir kullanıcıya geçin. - Alpine Kullan:
node:alpineveyapython:alpinegibi küçük imajları tercih edin. - .dockerignore:
node_modules,.git,.envgibi dosyaların imaja kopyalanmasını engelleyin. - Sırlar (Secrets): Veritabanı şifrelerini asla kodun içine gömmeyin,
.envdosyasından veya Docker Secrets'tan okuyun.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?