diff --git a/deploy.php b/deploy.php index 64c20ae..26f7f01 100644 --- a/deploy.php +++ b/deploy.php @@ -36,11 +36,12 @@ task('deploy:vendors', function () { }); // Build assets via container node éphémère -// --user assure que public/build/ appartient au user deploy et non root -// mangarr_node_modules volume = cache npm entre les déploiements +// Le cache webpack (node_modules/.cache) est persisté dans shared/webpack_cache entre les releases +// → 1er build lent, suivants compilent uniquement les modules modifiés desc('Build Webpack Encore assets'); task('webpack_encore:build', function () { - run('docker run --rm --user $(id -u):$(id -g) -e npm_config_cache=/tmp/npm-cache -e PUPPETEER_SKIP_DOWNLOAD=1 -v {{release_path}}:/app -w /app node:22-alpine sh -c "npm install && npm run build"'); + run('mkdir -p /srv/mangarr/shared/webpack_cache'); + run('docker run --rm --user $(id -u):$(id -g) -e npm_config_cache=/tmp/npm-cache -e PUPPETEER_SKIP_DOWNLOAD=1 -v {{release_path}}:/app -v /srv/mangarr/shared/webpack_cache:/app/node_modules/.cache -w /app node:22-alpine sh -c "npm install && npm run build"'); }); // Restart Docker containers (entrypoint gère les migrations automatiquement)