punimtag/viewer-frontend/scripts/with-sharp-libpath.sh
Tanya 51081c1b5d
Some checks failed
CI / test-backend (pull_request) Successful in 5m30s
CI / build (pull_request) Has been skipped
CI / secret-scanning (pull_request) Has been skipped
CI / dependency-scan (pull_request) Has been skipped
CI / sast-scan (pull_request) Has been skipped
CI / lint-and-type-check (pull_request) Has been cancelled
CI / python-lint (pull_request) Has been cancelled
CI / workflow-summary (pull_request) Has been cancelled
CI / skip-ci-check (pull_request) Has been cancelled
chore: Add deployment checklist and PM2 configuration examples
This commit introduces a new `DEPLOYMENT_CHECKLIST.md` file that outlines the necessary steps for configuring server-specific settings after pulling from Git. It includes instructions for environment files, PM2 configuration, firewall rules, database setup, and building frontends. Additionally, it adds an example `ecosystem.config.js.example` file for PM2 configuration, providing a template for users to customize for their deployment environment. The `.gitignore` file is updated to include the new PM2 ecosystem config file.
2026-01-19 15:20:39 -05:00

28 lines
841 B
Bash
Executable File

#!/bin/bash
# Helper script to set LD_LIBRARY_PATH for Sharp before running commands
# This ensures Sharp can find its bundled libvips library
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
SHARP_LIB_PATH="$PROJECT_DIR/node_modules/sharp/node_modules/@img/sharp-libvips-linux-x64/lib"
# Add node_modules/.bin to PATH if it exists
if [ -d "$PROJECT_DIR/node_modules/.bin" ]; then
export PATH="$PROJECT_DIR/node_modules/.bin:$PATH"
fi
# Change to project directory to ensure relative paths work
cd "$PROJECT_DIR" || exit 1
if [ -d "$SHARP_LIB_PATH" ]; then
export LD_LIBRARY_PATH="$SHARP_LIB_PATH:${LD_LIBRARY_PATH:-}"
exec "$@"
else
echo "Warning: Sharp libvips library not found at $SHARP_LIB_PATH"
echo "Sharp image processing may not work correctly."
exec "$@"
fi