express-prisma-coolify-image
Package an Express and Prisma API as a runtime-only image that migrates its Postgres database at start.
Skill by KhaledSaeed18
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/khaledsaeed18-express-prisma-coolify-image
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend, devops
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Node.js package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/express-prisma-coolify-image
What's inside
- Skill name
express-prisma-coolify-image- Description
- Package an Express and Prisma API as a runtime-only image that migrates its Postgres database at start. Use when containerising a Node API with a database, or when migrations, readiness or shutdown misbehave in production.
- License
- MIT
- Instructions
- 55 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (5)
- SKILL.md
- Dockerfile · templates/
- docker-entrypoint.sh · templates/
- dockerignore · templates/
- healthcheck.ts · templates/
SKILL.md (first lines)
The image carries compiled code, production dependencies and the migrations, applies pending migrations before it listens, and reports ready only when it can reach its database. Because a rolling update runs the new container beside the old one, every migration must be compatible with the previous release: expand, migrate, contract.
## Hard rules: never break these
- **Build natively on the runner, copy artifacts into the image.** No `pnpm install` inside Docker, no build on the server.
- **Migrations run in the entrypoint, with `prisma migrate deploy`, never `migrate dev`, `db push` or `migrate reset`.** The entrypoint applies them and then execs the server, so a failed migration stops the container before it takes traffic.
- **Applied migrations are immutable.** CI rejects any edit, rename or deletion under `prisma/migrations`; a mistake gets a new migration.
- **Every release starts from a restore-verified backup.** The deploy job takes one before touching the tag (the `vps-ops-toolkit` skill provides it).
- **Readiness means the database answers.** The probe calls the readiness route that runs a trivial query, so a container that cannot reach Postgres never takes traffic.
- **Non-root user, no host ports, a stop that finishes within 10 s.**
## Step 1: Audit the API
```bash
cat package.json | jq '{scripts, engines, packageManager}'
ls prisma prisma/migrations | head; cat prisma.config.ts 2>/dev/null
grep -rn "process.env" src/config | head -40
grep -rn "health" src/routes src/modules 2>/dev/null | head
```
List the runtime variables the app validates at boot (database URL, secrets, allowed origins, feature switches) and which have safe values for a smoke test. Note native or downloaded dependencies (a headless browser, image libraries): they must be fetched on the runner and copied in, with their shared libraries installed in the image.
## Step 2: Add the runtime files
| File | Purpose |
| --- | --- |
| [Dockerfile](./templates/Dockerfile) | `node:<major>-slim`, copies `node_modules`, `dist`, `prisma`, config and entrypoint; `USER node`; `HEALTHCHECK` on the probe |
| [docker-entrypoint.sh](./templates/docker-entrypoint.sh) | `prisma migrate deploy` when migrations exist, then `exec node dist/server.js` |
| [healthcheck.ts](./templates/healthcheck.ts) | compiled with the app; fetches the readiness route with a 4 s timeout |
| [.dockerignore](./templates/dockerignore) | keeps sources, tests, docs and env files out; `node_modules` and `dist` deliberately stay in |
Readiness route: `GET <prefix>/health/ready` runs `SELECT 1` through Prisma and answers `{status: "ok", checks: {database: "up"}}` with 200, or 503. Liveness `GET <prefix>/health` answers without touching the database.
## Step 3: Build the context on the runner
In this order, because an in-place `--prod` install leaves dev tooling in pnpm's store:
```bash
pnpm install --frozen-lockfile --ignore-scripts
pnpm run build # tsc -p tsconfig.build.json, prisma generate
rm -rf node_modules && pnpm install --prod --frozen-lockfile --ignore-scripts
ls node_modules/.pnpm/@prisma+engines@*/node_modules/@prisma/engines/schema-engine-* # the migrate engine must be present
```
The schema engine is downloaded by the Prisma CLI on first use; the container cannot download it at start as an unprivileged user over root-owned files, so prove it exists before `docker build`.
## Step 4: Smoke-test against a throwaway Postgres
In CI, a `postgres` service on a non-default port; locally, `docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=... postgres:17-alpine`. Start the image with `--network host`, a `DATABASE_URL` pointing at it, and safe values for every required variable. Loop `docker exec <c> node dist/healthcheck.js` until it exits 0 (migrations applied, database reachable), check `id -un` is `node`, then `docker stop -t 30` must return within 10 s with exit code 0. The full script is the image job in the `ghcr-coolify-pipeline` skill; the migration guard and the `migrate diff --exit-code` schema check belong in its quality job.
## Step 5: Hand over
Report the image size, the migration state the smoke test reached, the list of runtime variables Coolify must carry (names only), and any compatibility note for the next release (a column added now, removed later). Migration safety itself is the `db-migration-safety` skill.From KhaledSaeed18/dotclaude, MIT.
More from KhaledSaeed18/dotclaude
- 0.619score
ghcr-coolify-pipeline
KhaledSaeed18
Write the single GitHub Actions workflow that takes a repository from pull request to production through GHCR and Coolify.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
coolify-image-app
KhaledSaeed18
Create and configure a Coolify application that runs a prebuilt image from a registry.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
coolify-vps-baseline
KhaledSaeed18
Prepare a Linux VPS to run production containers under Coolify.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
deploy-verification
KhaledSaeed18
Prove a deployment from the server side.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
live-domain-cutover
KhaledSaeed18
Move a live domain from one host to another without downtime or lost sessions, with a rehearsal, a timed DNS switch, a soak and the old host removed.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
nextjs-coolify-image
KhaledSaeed18
Package a Next.js app as a runtime-only container image with a health probe and a fast shutdown.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
proxy-client-address
KhaledSaeed18
Forward the real client address from a server-side proxy to a backend without trusting forgeable headers.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
vps-ops-toolkit
KhaledSaeed18
Install host operations on a VPS, with a cron health check that alerts on change, restore-verified encrypted database backups, and an installer.
SkillAFreshness: A★ 5Claude Code +9 - 0.579score
dockerfile-best-practices
KhaledSaeed18
Write or review a Dockerfile and compose setup for a production service: multi-stage builds that ship only the runtime, pinned base images, layer order for…
SkillBFreshness: B★ 5Claude Code +9 - 0.579score
adr-writing
KhaledSaeed18
Write Architecture Decision Records that a future engineer can act on: a numbered, immutable record with the context that forced the decision, the options…
SkillBFreshness: B★ 5Claude Code +9 - 0.579score
openapi-spec
KhaledSaeed18
Write, generate, or review an OpenAPI 3.1 specification for an HTTP API so that it is accurate to the implementation, complete for consumers (schemas…
SkillBFreshness: B★ 5Claude Code +9 - 0.579score
api-design-review
KhaledSaeed18
Review an API contract (REST or GraphQL) before or while it is implemented, checking resource naming, HTTP semantics, status codes, error shape, pagination…
SkillBFreshness: B★ 5Claude Code +9
Signals
- Stars
- 5
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 5, 2026 (23 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/KhaledSaeed18/dotclaude
- Website
- dotclaude.khaledsaeed.tech/
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from KhaledSaeed18
- 0.619score
ghcr-coolify-pipeline
KhaledSaeed18
Write the single GitHub Actions workflow that takes a repository from pull request to production through GHCR and Coolify.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
live-domain-cutover
KhaledSaeed18
Move a live domain from one host to another without downtime or lost sessions, with a rehearsal, a timed DNS switch, a soak and the old host removed.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
coolify-image-app
KhaledSaeed18
Create and configure a Coolify application that runs a prebuilt image from a registry.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
coolify-vps-baseline
KhaledSaeed18
Prepare a Linux VPS to run production containers under Coolify.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
deploy-verification
KhaledSaeed18
Prove a deployment from the server side.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
nextjs-coolify-image
KhaledSaeed18
Package a Next.js app as a runtime-only container image with a health probe and a fast shutdown.
SkillAFreshness: A★ 5Claude Code +9
Cite this page
express-prisma-coolify-image skill. Agent Mart. https://agentmart.dev/skills/khaledsaeed18-express-prisma-coolify-image (last updated 2026-10-24)