docker-multi-stage-stack-builderlisted
Install: claude install-skill RMAzrim/opencode-artes
# Docker Multi-Stage Stack Builder
## 1. System Architecture & Prerequisites
This skill builds a complete production stack: a **multi-stage Next.js Docker image** (<100MB target), **PostgreSQL**, **Redis**, and an **Nginx reverse proxy** — all orchestrated via Docker Compose with health checks, volume persistence, and dependency ordering.
**Architecture layers:**
```
[Client] → [nginx:1.27-alpine] → [next-app:standalone] → [PostgreSQL 16] + [Redis 7]
```
**Prerequisites:**
- Docker ≥ 24 & Docker Compose V2 (`docker compose` plugin)
- Node.js ≥ 18 (for local development only)
- A working Next.js project with `output: "standalone"` in `next.config.ts`
## 2. Input/Output Data Contracts
**Input — Environment Variables (.env.example):**
```json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"required": ["POSTGRES_PASSWORD", "NEXTAUTH_SECRET"],
"properties": {
"POSTGRES_USER": { "type": "string", "default": "appuser" },
"POSTGRES_PASSWORD": { "type": "string", "description": "Strong password for PostgreSQL" },
"POSTGRES_DB": { "type": "string", "default": "appdb" },
"DATABASE_URL": { "type": "string", "description": "Full postgres:// connection string" },
"REDIS_URL": { "type": "string", "default": "redis://redis:6379" },
"NEXTAUTH_SECRET": { "type": "string", "description": "Auth secret for Next.js" },
"NEXTAUTH_URL": { "type": "string", "default": "http://localhost:3000" },
"NODE_ENV": { "type": "string",