@panoptic-it-solutions/coolify-setup 1.1.19 → 1.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,6 +36,9 @@ function generateNextjsDockerfile(options) {
36
36
  // postgres must be externalized due to pnpm's symlink structure causing resolution issues
37
37
  const migrationBundle = includePostgres ? `
38
38
 
39
+ # Create migrations folder if it doesn't exist (may be gitignored)
40
+ RUN mkdir -p ${dbPath}/migrations
41
+
39
42
  # Build the migration bundle (single JS file with all deps baked in)
40
43
  # This avoids module resolution issues in the standalone container
41
44
  # postgres is externalized and copied separately due to pnpm symlink resolution issues
@@ -2,17 +2,26 @@ export function generateEntrypoint(options) {
2
2
  const { projectType, includePostgres, dbPath } = options;
3
3
  // For Next.js standalone, we run the bundled JS file (no tsx needed)
4
4
  // For Node.js, we use tsx since full node_modules is available
5
+ // Check if migrations exist before running (folder may be empty if gitignored)
5
6
  const migrationStep = includePostgres
6
7
  ? projectType === 'nextjs'
7
8
  ? `
8
- # Run database migrations (bundled JS with all deps baked in)
9
- echo " Running database migrations..."
10
- node ${dbPath}/migrate.bundle.js
9
+ # Run database migrations if any exist (bundled JS with all deps baked in)
10
+ if [ -n "$(ls -A ${dbPath}/migrations 2>/dev/null)" ]; then
11
+ echo "⏳ Running database migrations..."
12
+ node ${dbPath}/migrate.bundle.js
13
+ else
14
+ echo "⏭️ No migrations found, skipping..."
15
+ fi
11
16
  `
12
17
  : `
13
- # Run database migrations
14
- echo " Running database migrations..."
15
- npx tsx scripts/migrate.ts
18
+ # Run database migrations if any exist
19
+ if [ -n "$(ls -A scripts/migrations 2>/dev/null)" ]; then
20
+ echo "⏳ Running database migrations..."
21
+ npx tsx scripts/migrate.ts
22
+ else
23
+ echo "⏭️ No migrations found, skipping..."
24
+ fi
16
25
  `
17
26
  : '';
18
27
  const startCmd = projectType === 'nextjs'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panoptic-it-solutions/coolify-setup",
3
- "version": "1.1.19",
3
+ "version": "1.1.20",
4
4
  "description": "CLI tool for setting up Coolify deployment on Panoptic projects",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",