-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-run.sh
More file actions
executable file
·37 lines (30 loc) · 972 Bytes
/
docker-run.sh
File metadata and controls
executable file
·37 lines (30 loc) · 972 Bytes
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
#!/bin/bash
# Enhanced Docker run script with more options
echo "🐳 PostgreSQL to DigitalOcean Spaces Backup Docker Runner"
echo "=================================================="
# Load environment variables to get PostgreSQL version
if [ -f ".env" ]; then
source .env
POSTGRES_VERSION=${POSTGRES_VERSION:-17}
else
POSTGRES_VERSION=17
fi
# Build the Docker image
echo "📦 Building Docker image with PostgreSQL version: $POSTGRES_VERSION"
docker build --build-arg POSTGRES_VERSION=$POSTGRES_VERSION -t postgres-spaces-backup .
# Check if build was successful
if [ $? -eq 0 ]; then
echo "✅ Docker image built successfully!"
echo ""
docker run \
--rm \
--name postgres-backup \
--env-file .env \
postgres-spaces-backup
echo ""
echo "🏁 Container execution completed!"
else
echo "❌ Docker build failed!"
echo "Make sure Docker Desktop is running and authenticated."
exit 1
fi