sb-dev/openquant / .agents/skills/docker-build-strategies
docker-build-strategies
FlaggedUse this skill when writing, reviewing, or optimizing Dockerfiles, even if the user just says their image is too large, their build is slow, or they need to harden a container for production. Covers multi-stage builds, layer caching, .dockerignore, non-root users, and image size optimization.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 11.9 KB |
| agents/openai.yaml | config | 256 B |
| assets/Dockerfile.go | script | 821 B |
| assets/Dockerfile.nodejs | other | 1.6 KB |
| assets/Dockerfile.python | other | 1.0 KB |
| assets/dockerignore-example | other | 644 B |
| checks/verification.md | markdown | 6.2 KB |
| references/layer-caching.md | markdown | 6.0 KB |
| references/multi-stage-builds.md | markdown | 8.6 KB |
| scripts/verify-build.shexecutable | script | 903 B |
| skill.yaml | config | 773 B |
assets/Dockerfile.python
View on GitHub# syntax=docker/dockerfile:1
# --- Build stage ---
FROM python:3.13-slim AS build
WORKDIR /src
# Create virtual environment
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
# Install dependencies (cached separately from source); bind-mount the
# manifest since pip install -r never rewrites it
RUN --mount=type=bind,source=requirements.txt,target=requirements.txt \
--mount=type=cache,target=/root/.cache/pip \
pip install --no-compile -r requirements.txt
# Copy application source
COPY . .
# --- Runtime stage ---
FROM python:3.13-slim AS runtime
WORKDIR /app
RUN addgroup --system --gid 1001 appgroup && \
adduser --system --uid 1001 --ingroup appgroup appuser
# Copy virtual environment and application from build stage
COPY --from=build --chown=appuser:appgroup /opt/venv /opt/venv
COPY --from=build --chown=appuser:appgroup /src /app
ENV PATH="/opt/venv/bin:$PATH"
USER appuser
EXPOSE 8000
LABEL org.opencontainers.image.source="<source-repository-url>"
ENTRYPOINT ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0"]
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |