deploy-docker
Skill0 starsChanged 15 days agoMITView on GitHub
Production packaging for Node.js Express backends — multi-stage Dockerfile (non-root, tini, healthcheck), entrypoint that runs Prisma migrations, docker-compose for local Postgres/Mongo/Redis, scheduler container with supercronic, health/readiness endpoints, graceful shutdown and an environment checklist. Use when preparing a backend to deploy, containerizing it, or debugging production startup.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- felvieira/claude-skills-fvtheir own version, first seen Sep 2, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- felvieira/claude-skills-fv★ 29same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository14 other files it gives its agents.
- ai-integrationSkill
- api-docsSkill
- auth-sessionsSkill
- backend-conventionsSkill
- backend-reviewSkill
- create-backendSkill
- mongoose-mongodbSkill
- new-moduleSkill
- nextjs-api-routesSkill
- prisma-postgresSkill
- redis-cacheSkill
- scheduled-jobsSkill
- security-hardeningSkill
- session-logSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 83
Keep only the services the project uses.
- Very specific: line 97
All required env vars set.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Deploy with Docker
Dockerfile
FROM node:22-alpine AS deps
WORKDIR /app
COPY package.json package-lock.json ./
COPY prisma ./prisma
RUN npm ci --omit=dev --ignore-scripts && npm run db:generate
FROM node:22-alpine AS runtime
WORKDIR /app
ENV NODE_ENV=production
RUN apk add --no-cache tini supercronic && addgroup -S app && adduser -S app -G app
COPY --from=deps /app/node_modules ./node_modules
COPY package.json package-lock.json ./
COPY prisma ./prisma
COPY src ./src
COPY cron ./cron
COPY docker-entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh && chown -R app:app /app
USER app
EXPOSE 5000
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
CMD ["node", "src/healthcheck.js"]
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/entrypoint.sh"]
CMD ["node", "src/server.js"]Mongoose projects drop the prisma lines. Drop supercronic and cron if there are no jobs. Add python3 make g++ to the deps stage only if a native module (bcrypt) needs building.
tinias PID 1 forwardsSIGTERMso graceful shutdown runs.- The health check runs
src/healthcheck.js(shipped in thecreate-backendtemplates), a tiny file that requests/v1/healthand exits 0 or 1. Keep probes as files in the image, not inline code. - Non-root user. No
.envbaked into the image; add a.dockerignorewithnode_modules,.env*,logs,.git,coverage.
Entrypoint (Prisma)
#!/bin/sh
set -e
if [ "${RUN_MIGRATIONS:-true}" = "true" ]; then
./node_modules/.bin/prisma migrate deploy
fi
exec "$@"With several API replicas, set RUN_MIGRATIONS=true on one release task only.
Local services (docker-compose.yml)
services:
postgres:
image: postgres:17-alpine
environment:
POSTGRES_USER: app
POSTGRES_PASSWORD: YOUR_DB_PASSWORD
POSTGRES_DB: app
ports: ['5432:5432']
volumes: [postgres-data:/var/lib/postgresql/data]
healthcheck: { test: ['CMD-SHELL', 'pg_isready -U app -d app'], interval: 10s, retries: 5 }
mongo:
image: mongo:8
ports: ['27017:27017']
volumes: [mongo-data:/data/db]
redis:
image: redis:7-alpine
command: ['redis-server', '--appendonly', 'yes']
ports: ['6379:6379']
volumes: [redis-data:/data]
volumes:
postgres-data:
mongo-data:
redis-data:Keep only the services the project uses. Use pgvector/pgvector:pg17 if you need vector search. Mongo transactions need a replica set (--replSet rs0 + rs.initiate()).
Scheduler
Same image, different command: command: ["supercronic", "/app/cron/prod.crontab"]. Run exactly one scheduler replica (see scheduled-jobs).
Health
GET /v1/health— liveness, no dependencies, always fast.GET /v1/health/ready— checks the database (and Redis as informational); 503 when the database is down. Point load balancers at readiness, container healthchecks at liveness.
Production checklist
NODE_ENV=production;trust proxymatches the proxy count; CORS origins are the real domains.- All required env vars set; secrets differ per environment;
AI_KEY_ENCRYPTION_SECRET/ JWT secrets are random 32+ bytes. - Logs go to stdout as JSON; no secrets in logs.
- Graceful shutdown: stop accepting, finish in-flight requests, close DB/Redis, force-exit after 30 s.
- Database: pooled connection limits fit the provider; migrations applied; backups on.
- Rate limiting enabled; Redis reachable or the app degrades cleanly without it.
- Behind nginx:
proxy_buffering off(orX-Accel-Buffering: no) on SSE routes; request body limit matches Express.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

