Files
video-downloader/scripts/deploy.sh
T
anthonyandClaude Sonnet 5 fd0bc092bd fix: fix o2switch deployment build and yt-dlp Python compatibility
Turbopack requires native SWC bindings unavailable on o2switch's old
glibc, so force webpack for production builds. NODE_ENV=production on
o2switch's shell also caused npm to skip devDependencies needed at
build time (Tailwind, PostCSS), so deploy now installs with
--include=dev.

yt-dlp's standalone PyInstaller binary self-extracts to noexec /tmp
and fails to mmap its bundled shared libs there, and o2switch's system
python3 (3.6) is too old for the plain zipapp. Revert to the zipapp
and invoke it explicitly through a configurable PYTHON_BIN, set to
o2switch's newer Python 3.11 in .env.prod.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-11 16:13:12 +02:00

27 lines
650 B
Bash

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
echo "==> Copie de .env.prod vers .env"
cp .env.prod .env
echo "==> Installation des dependances"
npm install --include=dev
echo "==> Generation du client Prisma"
npm run db:generate
echo "==> Application des migrations Prisma (production)"
npm run db:migrate:deploy
echo "==> Build de production"
npm run build
echo "==> Demarrage/redemarrage du worker sous pm2"
pm2 startOrRestart ecosystem.config.cjs
pm2 save
echo "==> Deploiement termine."
echo "Pensez a redemarrer l'app Next.js via cPanel > Setup Node.js App si Passenger ne recharge pas automatiquement le nouveau build."