Skip to content

sb-dev/openquant / .agents/skills/docker-project-foundations

docker-project-foundations

Flagged

Use this skill when setting up, initializing, or Dockerizing a project, even if the user doesn't explicitly mention Docker but describes a need for containerized local development, adding a database or cache dependency, or running services without host-level installs. Covers Dockerfile, compose.yaml, and .dockerignore creation with Docker best practices.

FileKindSize
SKILL.mdskill md7.3 KB
agents/openai.yamlconfig269 B
assets/Dockerfile.simpleother959 B
assets/compose-dev.yamlconfig1.5 KB
assets/dockerignore-exampleother654 B
checks/verification.mdmarkdown4.1 KB
references/project-structure.mdmarkdown3.3 KB
scripts/verify-setup.shexecutablescript1.1 KB
skill.yamlconfig853 B

references/project-structure.md

View on GitHub
# Docker Project Structure Reference

## Standard single-service layout

```
project-root/
  .dockerignore
  Dockerfile
  compose.yaml
  src/
  ...
```

For most projects, all Docker files live at the project root. This is the simplest and most conventional layout.

## Multi-service layout

When a repository contains multiple independently built services (e.g., a monorepo with `frontend/` and `backend/`):

```
project-root/
  compose.yaml
  frontend/
    .dockerignore
    Dockerfile
    src/
  backend/
    .dockerignore
    Dockerfile
    src/
```

Each service gets its own `Dockerfile` and `.dockerignore` at the root of its build context. The `compose.yaml` stays at the repository root and references each service's build context:

```yaml
services:
  frontend:
    build:
      context: ./frontend
      dockerfile: Dockerfile
  backend:
    build:
      context: ./backend
      dockerfile: Dockerfile
```

## File naming conventions

| File | Correct name | Deprecated/incorrect alternatives |
|------|-------------|----------------------------------|
| Compose file | `compose.yaml` | `docker-compose.yml`, `docker-compose.yaml` |
| Dockerfile | `Dockerfile` | `dockerfile`, `Dockerfile.dev` (use stages instead) |
| Ignore file | `.dockerignore` | — |

## Build context considerations

The Docker build context is the directory tree sent to the Docker daemon during a build. Key rules:

- The `.dockerignore` file controls what is excluded from the build context.
- A smaller build context means faster builds. Aggressively exclude anything the build does not need.
- The build context root is set by the `context` field in `compose.yaml` or by the path argument to `docker build`.
- Files outside the build context cannot be referenced in a `Dockerfile` (no `COPY ../something`).

## Compose file organization

### Environment variables

Prefer inline `environment:` blocks for small numbers of variables. Use `env_file:` for larger configurations, but never commit files containing real secrets.

```yaml
services:
  app:
    environment:
      - DATABASE_URL=postgres://user:pass@db:5432/myapp
      - REDIS_URL=redis://cache:6379
```

### Volumes

- **Named volumes** for data that must survive container restarts (database storage):

```yaml
volumes:
  db-data:

services:
  db:
    volumes:
      - db-data:/var/lib/postgresql/data
```

- **Bind mounts** for source code during development:

```yaml
services:
  app:
    volumes:
      - ./src:/app/src
```

### Networks

For most single-project development setups, the default Compose network is sufficient. Do not create custom networks unless services need isolation from each other.

### Profiles

Use Compose profiles to group optional services (e.g., monitoring, debug tools) that are not needed in every development session:

```yaml
services:
  prometheus:
    profiles:
      - monitoring
    image: prom/prometheus:v3
```

Start with `docker compose --profile monitoring up` when needed.

## Secrets and credentials

- Never bake secrets into images (no `ENV SECRET_KEY=...` in a `Dockerfile`).
- Use environment variables or Docker secrets for runtime credentials.
- Add secret files (`.env`, `*.pem`, `credentials.json`) to `.dockerignore` and `.gitignore`.
- For development, use `env_file:` in Compose pointing to a `.env` file that is gitignored.
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 319kUpdated Claude CodeCodexVerifiedInstall
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: 196kUpdated Claude CodeCodexVerifiedInstall
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: 118kUpdated Claude CodeCodexVerifiedInstall
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: 118kUpdated Claude CodeCodexVerifiedInstall