You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
834 B
30 lines
834 B
#!/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."
|