#!/bin/bash set -e cd "$(dirname "$0")/.." echo "=== radiOLA Backend Deploy ===" # Pull latest changes if in git repo if [ -d .git ]; then git pull origin main || true fi # Ensure .env exists if [ ! -f .env ]; then echo "Warning: .env not found. Copying from .env.example" cp .env.example .env fi # Build and start echo "Building Docker images..." docker compose build --no-cache echo "Starting services..." docker compose up -d echo "Running database migrations..." docker compose exec -T app npx prisma migrate deploy echo "=== Deploy complete ===" echo "API: http://$(curl -s ifconfig.me || echo 'localhost')"