-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdeploy.sh
More file actions
49 lines (38 loc) Β· 1.06 KB
/
deploy.sh
File metadata and controls
49 lines (38 loc) Β· 1.06 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
#!/bin/bash
# Deployment script for Predictions App
# Run this on your Linode server
set -e # Exit on error
echo "π Starting deployment..."
# Pull latest code
echo "π₯ Pulling latest code from git..."
git pull origin master # or your branch name
# Stop existing container
echo "π Stopping existing container..."
docker-compose down
# Rebuild and start
echo "π¨ Building new container..."
docker-compose build --no-cache
echo "βΆοΈ Starting container..."
docker-compose up -d
# Wait for healthcheck
echo "β³ Waiting for app to be healthy..."
sleep 10
# Check if container is running
if [ "$(docker ps -q -f name=predictions-app)" ]; then
echo "β
Deployment successful!"
echo ""
echo "π Container status:"
docker-compose ps
echo ""
echo "π Recent logs:"
docker-compose logs --tail=20
else
echo "β Deployment failed - container not running"
echo "π Logs:"
docker-compose logs
exit 1
fi
# Clean up old images
echo "π§Ή Cleaning up old Docker images..."
docker image prune -f
echo "β¨ Deployment complete!"