-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·60 lines (49 loc) · 1.71 KB
/
deploy.sh
File metadata and controls
executable file
·60 lines (49 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
# Neo-docs deployment script for DigitalOcean droplet
set -e
echo "🚀 Starting Neo-docs deployment..."
# Check if docker and docker-compose are installed
if ! command -v docker &> /dev/null; then
echo "Installing Docker..."
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
systemctl start docker
systemctl enable docker
fi
if ! command -v docker-compose &> /dev/null; then
echo "Installing Docker Compose..."
curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
fi
# Clone or update repository
if [ -d "neo-docs" ]; then
echo "📥 Updating repository..."
cd neo-docs
git pull origin master
else
echo "📥 Cloning repository..."
git clone https://github.com/omar-elbaz/neo-docs.git
cd neo-docs
fi
# Check if .env file exists
if [ ! -f ".env" ]; then
echo "❌ .env file not found! Please create .env file with required variables."
echo "See .env.example for reference"
exit 1
fi
# Stop existing containers
echo "🛑 Stopping existing containers..."
docker-compose -f docker-compose.prod.yml down || true
# Pull latest images and build
echo "🔨 Building and starting services..."
docker-compose -f docker-compose.prod.yml up -d --build
# Wait for services to be healthy
echo "⏳ Waiting for services to be ready..."
sleep 30
# Check service status
echo "📊 Service status:"
docker-compose -f docker-compose.prod.yml ps
echo "✅ Deployment complete!"
echo "🌐 Your application should be available at:"
echo " Frontend: http://$(curl -s ifconfig.me)"
echo " Backend API: http://$(curl -s ifconfig.me):3001"