diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..5a3a6b1 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,30 @@ +#!/bin/bash +set -e + +echo "=== Divar Crawler Production Deployment Script ===" + +# Check if docker is installed +if ! command -v docker &> /dev/null; then + echo "Error: docker is not installed. Please install Docker and Docker Compose." + exit 1 +fi + +# Create .env from .env.example if missing +if [ ! -f .env ]; then + echo "Creating .env from .env.example..." + cp .env.example .env + echo "WARNING: Please edit .env and set your OPENAI_API_KEY and passwords before running!" +fi + +echo "Pulling latest code changes..." +git pull origin master || true + +echo "Building and launching containers..." +docker compose down || true +docker compose up -d --build + +echo "Checking container statuses..." +docker compose ps + +echo "=== Deployment Successful! ===" +echo "Access the application at http://localhost or your server's IP address."