This repository was archived by the owner on Feb 11, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-docker.sh
More file actions
42 lines (32 loc) · 1.29 KB
/
deploy-docker.sh
File metadata and controls
42 lines (32 loc) · 1.29 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
#!/bin/bash
echo "🚀 Deploying Barde Lingo with Docker..."
# Pull latest changes
echo "📥 Pulling latest code..."
git pull origin main
# Build Docker image
echo "🔨 Building Docker image..."
docker-compose -f docker-compose.production.yml build --no-cache
# Stop existing containers
echo "🛑 Stopping existing containers..."
docker-compose -f docker-compose.production.yml down
# Start new containers
echo "▶️ Starting new containers..."
docker-compose -f docker-compose.production.yml up -d
# Wait for containers to be ready
echo "⏳ Waiting for containers to be ready..."
sleep 5
# Run migrations
echo "🗄️ Running migrations..."
docker-compose -f docker-compose.production.yml exec -T app php artisan migrate --force
# Cache optimization
echo "⚡ Optimizing cache..."
docker-compose -f docker-compose.production.yml exec -T app php artisan config:cache
docker-compose -f docker-compose.production.yml exec -T app php artisan route:cache
docker-compose -f docker-compose.production.yml exec -T app php artisan view:cache
docker-compose -f docker-compose.production.yml exec -T app php artisan event:cache
# Clean up old images
echo "🧹 Cleaning up..."
docker image prune -f
echo "✅ Deployment complete!"
echo "📊 Container status:"
docker-compose -f docker-compose.production.yml ps