Files
romm/entrypoint.sh
Georges-Antoine Assi 393c886a80 final tweaks
2025-06-19 09:54:00 -04:00

32 lines
772 B
Bash

#!/bin/bash
set -e
echo "Starting entrypoint script..."
# Create symlinks for frontend
mkdir -p /app/frontend/assets/romm
ln -sf /app/romm/resources /app/frontend/assets/romm/resources
ln -sf /app/romm/assets /app/frontend/assets/romm/assets
# Define a signal handler to propagate termination signals
function handle_termination() {
echo "Terminating child processes..."
# trunk-ignore(shellcheck)
kill -TERM $(jobs -p) 2>/dev/null
}
# Trap SIGTERM and SIGINT signals
trap handle_termination SIGTERM SIGINT
# Start all services in the background
cd /app/backend
poetry run python main.py &
OBJC_DISABLE_INITIALIZE_FORK_SAFETY=1 poetry run python worker.py &
# Start the frontend dev server
cd /app/frontend
npm run dev &
# Wait for all background processes
wait