一键导入
docker-build
Use when creating or updating Docker configurations, Dockerfiles, or docker-compose setups for Go, Python, or React projects
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when creating or updating Docker configurations, Dockerfiles, or docker-compose setups for Go, Python, or React projects
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when the user wants to free disk space, investigate disk usage, clean caches, remove unused artifacts, or when disk capacity is high. Also use when asked to "clean up", "free space", "disk full", or "what's using disk space". Always uses AskUserQuestion for every deletion decision.
Use at the start of every conversation and for every user message — orchestrates the full engineering skills suite by understanding intent, clarifying requirements interactively, and invoking the right skills
Use when refactoring Go code, cleaning up legacy codebases, optimizing performance, or enforcing clean architecture boundaries in a Go/Fiber backend
Use when refactoring Python code, cleaning up legacy codebases, optimizing performance, enforcing type safety, or improving clean architecture in a FastAPI backend
Use when refactoring React components, cleaning up legacy frontends, optimizing performance, improving component architecture, or reducing bundle size
Use when reviewing changed code before committing or after completing a feature — checks performance, architecture, type safety, and code quality against project standards
| name | docker-build |
| description | Use when creating or updating Docker configurations, Dockerfiles, or docker-compose setups for Go, Python, or React projects |
Production-ready Docker configurations for Go, Python/FastAPI, and React/Bun. Multi-stage builds, Docker Compose for local dev, and optimization patterns.
Core principle: Small images, fast builds, layer caching. Dev and prod parity.
FROM golang:1.23-alpine AS builder
RUN apk add --no-cache git
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /bin/api ./cmd/api
FROM alpine:3.20
RUN apk add --no-cache ca-certificates tzdata
COPY --from=builder /bin/api /bin/api
COPY migrations/ /migrations/
EXPOSE 8000
ENTRYPOINT ["/bin/api"]
FROM python:3.12-slim AS builder
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
WORKDIR /app
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-dev --no-editable
COPY src/ src/
COPY alembic/ alembic/
COPY alembic.ini .
FROM python:3.12-slim
COPY --from=builder /app /app
WORKDIR /app
ENV PATH="/app/.venv/bin:$PATH"
EXPOSE 8000
CMD ["uvicorn", "src.main:create_app", "--factory", "--host", "0.0.0.0", "--port", "8000"]
FROM oven/bun:1 AS build
WORKDIR /app
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile
COPY . .
RUN bun run build
FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
server {
listen 80;
root /usr/share/nginx/html;
index index.html;
location /api/ {
proxy_pass http://api:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location / {
try_files $uri $uri/ /index.html;
}
gzip on;
gzip_types text/css application/javascript application/json;
}
services:
api:
build: ./backend
ports: ["8000:8000"]
environment:
DATABASE_URL: postgres://app:secret@postgres:5432/app?sslmode=disable
REDIS_URL: redis://redis:6379
depends_on:
postgres: { condition: service_healthy }
volumes: ["./backend:/app"] # dev only
command: air # dev only
web:
build: ./frontend
ports: ["5173:5173"]
volumes: ["./frontend/src:/app/src"] # dev only
command: bun dev --host # dev only
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: app
POSTGRES_PASSWORD: secret
POSTGRES_DB: app
ports: ["5432:5432"]
volumes: [pgdata:/var/lib/postgresql/data]
healthcheck:
test: pg_isready -U app
interval: 5s
retries: 5
redis:
image: redis:7-alpine
ports: ["6379:6379"]
volumes:
pgdata:
Replace the api service:
api:
build: ./backend
ports: ["8000:8000"]
environment:
DATABASE_URL: postgresql+asyncpg://app:secret@postgres:5432/app
REDIS_URL: redis://redis:6379
depends_on:
postgres: { condition: service_healthy }
volumes: ["./backend:/app"]
command: uvicorn src.main:create_app --factory --reload --host 0.0.0.0
.git
.env
node_modules
__pycache__
*.pyc
.pytest_cache
.mypy_cache
.ruff_cache
tmp/
dist/
bin/
| Technique | Benefit |
|---|---|
| Multi-stage builds | Smaller final image |
| Copy dependency files first | Layer caching |
--frozen-lockfile / --frozen | Reproducible builds |
| Alpine / slim base | Smaller image |
.dockerignore | Faster context |
CGO_ENABLED=0 (Go) | Static binary |
--no-dev (Python) | Skip dev deps |
# For API containers
healthcheck:
test: wget -q --spider http://localhost:8000/health || exit 1
interval: 10s
timeout: 5s
retries: 3
claude-md)go-scaffold / py-scaffold / react-scaffold (during project setup)ci-pipeline (build stage) → deploy (production deployment)