2025-05-18 00:18:54 -05:00

34 lines
886 B
Bash
Executable File

#!/bin/bash
echo "⚠️ This will DELETE your containers, SQLite DB, Alembic migrations, cache, uploads, logs."
read -p "Continue? (y/N): " confirm
if [[ "$confirm" != "y" && "$confirm" != "Y" ]]; then
echo "❌ Aborted."
exit 1
fi
echo "🛑 Stopping and removing containers and volumes..."
docker compose down --volumes --remove-orphans
echo "🗑 Removing mounted DB file..."
rm -f ./app/app.db
echo "🧹 Removing Alembic migrations..."
sudo rm -rf migrations/
echo "🧼 Removing Python cache and compiled files..."
sudo find . -type d -name '__pycache__' -exec rm -rf {} +
sudo find . -name '*.pyc' -delete
sudo find . -name '*.pyo' -delete
echo "🧽 Removing static uploads and logs..."
rm -rf app/static/uploads/*
rm -rf logs/
echo "🔨 Rebuilding containers..."
docker compose build --no-cache
echo "🚀 Starting up..."
docker compose up --force-recreate