-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
74 lines (61 loc) · 2.03 KB
/
deploy.sh
File metadata and controls
74 lines (61 loc) · 2.03 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
# Flux Application Deployment Script
set -e
echo "🚀 Starting Flux application deployment..."
# Check if Docker is installed
if ! command -v docker &> /dev/null; then
echo "❌ Docker is not installed. Please install Docker first."
exit 1
fi
# Check if Docker Compose is installed
if ! command -v docker-compose &> /dev/null; then
echo "❌ Docker Compose is not installed. Please install Docker Compose first."
exit 1
fi
# Copy environment file if it doesn't exist
if [ ! -f .env ]; then
echo "📋 Creating .env file from template..."
cp .env.example .env
echo "⚠️ Please edit .env file with your configuration before running deployment"
exit 1
fi
# Create SSL directory if it doesn't exist
if [ ! -d ssl ]; then
echo "📁 Creating SSL directory..."
mkdir -p ssl
echo "⚠️ Please add your SSL certificates to the ssl/ directory"
echo " - ssl/cert.pem (certificate file)"
echo " - ssl/key.pem (private key file)"
fi
# Create logs directory
echo "📁 Creating logs directory..."
mkdir -p flux_back/logs
# Build and start services
echo "🏗️ Building and starting services..."
docker-compose down --remove-orphans
docker-compose build --no-cache
docker-compose up -d
echo "⏳ Waiting for services to start..."
sleep 30
# Check service health
echo "🔍 Checking service health..."
docker-compose ps
# Show logs
echo "📋 Showing recent logs..."
docker-compose logs --tail=50
echo "✅ Deployment completed!"
echo ""
echo "🌐 Application URLs:"
echo " - Frontend: https://localhost"
echo " - Backend API: https://localhost/api"
echo " - WebSocket: wss://localhost/ws"
echo ""
echo "📊 Health endpoints:"
echo " - Nginx: https://localhost/health"
echo " - Backend: http://localhost:8080/actuator/health"
echo ""
echo "📝 Useful commands:"
echo " - View logs: docker-compose logs -f [service]"
echo " - Stop services: docker-compose down"
echo " - Restart services: docker-compose restart"
echo " - Update and restart: docker-compose pull && docker-compose up -d"