rybbit/update.sh
Bill Yang c6352c9b42 Refactor Docker commands in setup and update scripts
- Removed the `--build` flag from `docker compose up` commands in both `setup.sh` and `update.sh` to streamline service startup.
- Deleted the `self-hosting-upgrading.mdx` documentation file as it was deemed unnecessary.
- Updated the title in `self-hosting.mdx` for clarity, changing it from "Setup" to "Self Hosting Guide".
2025-05-06 13:26:49 -07:00

38 lines
No EOL
942 B
Bash

#!/bin/bash
# Exit immediately if a command exits with a non-zero status.
set -e
echo "Updating to the latest version..."
# Pull latest changes from git repository
echo "Pulling latest code..."
git pull
# Stop running containers
echo "Stopping current services..."
docker compose down
# Check if .env file exists
if [ ! -f .env ]; then
echo "Error: .env file not found. Please run setup.sh first."
echo "Usage: ./setup.sh <domain_name>"
exit 1
fi
# Rebuild and start containers
echo "Rebuilding and starting updated services..."
# Load environment variables
source .env
if [ "$USE_WEBSERVER" = "false" ]; then
# Start without the caddy service when using --no-webserver
docker compose up -d backend client clickhouse postgres
else
# Start all services including caddy
docker compose up -d
fi
echo "Update complete. Services are running with the latest version."
echo "You can monitor logs with: docker compose logs -f"