CLI tool for setting up Coolify deployment on Panoptic projects
npm install @panoptic-it-solutions/coolify-setupCLI tool for setting up Coolify deployment on Panoptic projects.
``bash`
npx @panoptic-it-solutions/coolify-setup
Or install globally:
`bash`
npm i -g @panoptic-it-solutions/coolify-setup
coolify-setup
This CLI tool automates the setup of Coolify deployment for your project:
1. Detects your project type (Next.js or Node.js)
2. Detects your package manager (pnpm, npm, or yarn)
3. 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
4. Sets up GitHub repository (optional):
- Creates repo in Panoptic-IT-Solutions org
- Pushes main, staging, and develop branches
- Sets develop as default branch
- Registry: 10.0.0.2:5000Panoptic-IT-Solutions
- GitHub Org: self-hosted
- CI Runner: develop
- Branch Strategy:
- - Default branch for developmentstaging
- - Deploy target for all branchesmain
- - Production (manual promotion)
The CLI will prompt you to include:
- PostgreSQL (with automatic migration support)
- Redis
- MinIO (S3-compatible storage)
If PostgreSQL is included, the CLI generates migration infrastructure:
Next.js uses output: 'standalone' which creates a minimal deployment without full node_modules. To handle migrations:
1. esbuild is added to devDependencies (automatically)
2. Migration script is bundled at Docker build time into a single JS file with all dependencies
3. 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 keep full node_modules, so migrations run with tsx:
Files generated:
- scripts/migrate.ts - Migration scriptnpx tsx
- Uses at runtime
- Skips during Docker build - Detects placeholder database URLs
- Runs on container startup - Before the application starts
- Idempotent - Drizzle tracks applied migrations
- 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)
MIT