.claude/skills/docker/SKILL.md
Builds single-container deployments with PostgreSQL, Nginx, and Supervisor for the Luxia e-commerce platform. Use when: modifying Dockerfile, docker-compose.yml, nginx.conf, supervisord.conf, or deployment scripts.
npx skillsauth add kaxuna1/ecomsite dockerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Single-container architecture bundling PostgreSQL 14, Node.js 20 backend, Nginx reverse proxy, and Supervisor process manager. Multi-stage builds optimize image size while supporting both AMD64 and ARM64 architectures.
# Docker Compose (recommended)
docker-compose up -d
# Manual build
docker build -t luxia-ecommerce:latest .
docker run -d -p 80:80 \
-e JWT_SECRET=$(openssl rand -base64 32) \
-e DB_PASSWORD=secure_password \
-e POSTGRES_PASSWORD=secure_password \
-v luxia-postgres:/var/lib/postgresql/data \
-v luxia-uploads:/app/backend/uploads \
luxia-ecommerce:latest
./docker/build-multiarch.sh
# Or with registry:
REGISTRY=your.registry.com ./docker/build-multiarch.sh
| Concept | Location | Purpose |
|---------|----------|---------|
| Multi-stage build | Dockerfile | Separate frontend/backend builders, final Ubuntu runtime |
| Supervisor | docker/supervisord.conf | Manages PostgreSQL → migrations → backend → nginx startup order |
| Nginx proxy | docker/nginx.conf | Routes /api/* to backend, serves static files |
| Health check | Dockerfile:113 | Verifies /api/health endpoint |
Supervisor starts services in priority order:
# docker/supervisord.conf
[program:postgresql]
priority=1 # Start first
[program:migrations]
priority=2 # Run after DB ready
[program:backend]
priority=3 # Start after migrations
[program:nginx]
priority=4 # Start last
# docker-compose.yml
volumes:
- postgres_data:/var/lib/postgresql/data # Database
- uploads_data:/app/backend/uploads # User uploads
Critical variables for production:
| Variable | Purpose |
|----------|---------|
| JWT_SECRET | Token signing (use openssl rand -base64 32) |
| DB_PASSWORD | PostgreSQL password |
| POSTGRES_PASSWORD | Must match DB_PASSWORD |
For PostgreSQL configuration details, see the postgresql skill. For backend service patterns, see the express skill. For Node.js runtime specifics, see the node skill.
tools
Zustand lightweight state management with persistence and middleware. Use when: managing client-side state (cart, auth, UI preferences), replacing React Context with simpler API, accessing state outside React components, implementing localStorage persistence
development
Zod schema validation and TypeScript integration for runtime type safety. Use when: Validating API payloads, form inputs, environment variables, or any external data boundaries where TypeScript types alone cannot guarantee safety.
tools
Configures Vite 5.x build tool, dev server, and frontend asset optimization for the Luxia e-commerce platform. Use when: configuring builds, adding environment variables, optimizing bundle size, setting up testing, debugging HMR issues, or adding Vite plugins.
development
Enforces strict TypeScript types across frontend and backend codebases. Use when: Writing new services, DTOs, interfaces, type guards, debugging type errors, or ensuring type safety at API boundaries.