Skip to content
Back to skills

Docker Database Package Copy

ASecurity

When adding or changing TypeScript under a shared workspace database package that its entrypoint re-exports, update every consumer service Dockerfile's COPY list or the container build fails with TS2307. Use for shared database-package modules, Dockerfile edits, or "works locally but the container build breaks".

  • 4 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 2, 2026
ai-agentstypescriptbashdockerdatabase

Security analysis

A100/100

Scanned November 9, 2026

npx -y skills add eric-sabe/engsys --skill docker-database-package-copy --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Docker Database Package Copy?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Docker Database Package Copy
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/eric-sabe-docker-database-package-copy/badge)](https://www.skillsdirectory.com/skills/eric-sabe-docker-database-package-copy)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: docker-database-package-copy
description: When adding or changing TypeScript under a shared workspace database package that its entrypoint re-exports, update every consumer service Dockerfile's COPY list or the container build fails with TS2307. Use for shared database-package modules, Dockerfile edits, or "works locally but the container build breaks".
---

# Docker COPY Discipline for Shared Workspace Packages

Applies to monorepos where a shared Prisma/database package (e.g., `packages/database`) is consumed by multiple containerized services, and each service `Dockerfile` copies **specific** source files rather than the entire workspace tree.

> Naturalize: replace `packages/database` and `apps/` with this repository's shared database-package path and service directory in `CLAUDE.md`.

## Trigger

- A new or renamed `.ts` source file under the shared database package is reachable from its barrel entrypoint.
- A PR modifies the database package's exports **and** a service `Dockerfile`.

## Procedure

1. Find every `Dockerfile` that copies files from the shared database package:
   ```bash
   rg 'COPY packages/database/' apps -g Dockerfile
   ```
2. For each **new** exported source file, add a matching `COPY` instruction to every consumer `Dockerfile`:
   ```dockerfile
   COPY packages/database/<filename>.ts ./packages/database/
   ```
3. Smoke-build at least one consumer container image before pushing:
   ```bash
   docker build -f apps/<service>/Dockerfile -t db-copy-probe .
   ```

## Why

A local workspace build (`pnpm build`) resolves the full checkout on disk, whereas Docker build stages only see explicitly `COPY`'d files. A missing `COPY` line passes local typechecking and fails in CI container builds with `TS2307: Cannot find module`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.