diff --git a/.dockerignore b/.dockerignore index 55f56a5122..2beee38eae 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,7 @@ +# We want to include the THIRD_PARTY_LICENSES.md file in the Docker image, +# but not other .md files **/*.md +!**/THIRD_PARTY_LICENSES.md **/.env .cache assets diff --git a/scripts/build-n8n.mjs b/scripts/build-n8n.mjs index 1afddf2527..1f1d35c4ed 100755 --- a/scripts/build-n8n.mjs +++ b/scripts/build-n8n.mjs @@ -30,6 +30,7 @@ const rootDir = isInScriptsDir ? path.join(scriptDir, '..') : scriptDir; const config = { compiledAppDir: path.join(rootDir, 'compiled'), compiledTaskRunnerDir: path.join(rootDir, 'dist', 'task-runner-javascript'), + cliDir: path.join(rootDir, 'packages', 'cli'), rootDir: rootDir, }; @@ -117,7 +118,6 @@ try { } echo(chalk.green('āœ… pnpm install and build completed')); - } catch (error) { console.error(chalk.red('\nšŸ›‘ BUILD PROCESS FAILED!')); console.error(chalk.red('An error occurred during the build process:')); @@ -246,6 +246,12 @@ const buildManifest = { }, }; +// Copy third-party licenses if they exist +const licensesSourcePath = path.join(config.cliDir, 'THIRD_PARTY_LICENSES.md'); +if (await fs.pathExists(licensesSourcePath)) { + await fs.copy(licensesSourcePath, path.join(config.compiledAppDir, 'THIRD_PARTY_LICENSES.md')); +} + await fs.writeJson(path.join(config.compiledAppDir, 'build-manifest.json'), buildManifest, { spaces: 2, });