@panoptic-it-solutions/coolify-setup
v1.1.48
Published
CLI tool for setting up Coolify deployment on Panoptic projects
Readme
@panoptic-it-solutions/coolify-setup
CLI tool for setting up Coolify deployment on Panoptic projects.
Usage
npx @panoptic-it-solutions/coolify-setupOr install globally:
npm i -g @panoptic-it-solutions/coolify-setup
coolify-setupWhat it does
This CLI tool automates the setup of Coolify deployment for your project:
- Detects your project type (Next.js or Node.js)
- Detects your package manager (pnpm, npm, or yarn)
- Generates deployment files:
Dockerfile- Multi-stage build optimized for your projectdocker-compose.yml- Production configuration with optional servicesdocker-compose.build.yml- Build configuration for CI.github/workflows/build-deploy.yml- GitHub Actions workflowentrypoint.sh- Container startup script with migration support.claude/rules/coolify.md- Coolify deployment rules for Claude
- Sets up GitHub repository (optional):
- Creates repo in Panoptic-IT-Solutions org
- Pushes main, staging, and develop branches
- Sets develop as default branch
Hardcoded Panoptic Defaults
- Registry:
10.0.0.2:5000 - GitHub Org:
Panoptic-IT-Solutions - CI Runner:
self-hosted - Branch Strategy:
develop- Default branch for developmentstaging- Deploy target for all branchesmain- Production (manual promotion)
Optional Services
The CLI will prompt you to include:
- PostgreSQL (with automatic migration support)
- Redis
- MinIO (S3-compatible storage)
Migration Handling
If PostgreSQL is included, the CLI generates migration infrastructure:
Next.js Projects (with standalone output)
Next.js uses output: 'standalone' which creates a minimal deployment without full node_modules. To handle migrations:
- esbuild is added to devDependencies (automatically)
- Migration script is bundled at Docker build time into a single JS file with all dependencies
- Bundled JS runs with plain Node.js at container startup (no tsx needed)
Files generated:
lib/db/migrate.ts- Migration script source (if not existing)lib/db/migrate.bundle.js- Bundled migration (created during Docker build)
Node.js Projects
Node.js projects keep full node_modules, so migrations run with tsx:
Files generated:
scripts/migrate.ts- Migration script- Uses
npx tsxat runtime
Migration Behavior
- Skips during Docker build - Detects placeholder database URLs
- Runs on container startup - Before the application starts
- Idempotent - Drizzle tracks applied migrations
Requirements
- Node.js 18+
- GitHub CLI (
gh) installed and authenticated (for repo creation) - Git initialized in your project
- For Next.js + PostgreSQL: esbuild (automatically added to devDependencies)
License
MIT
