Files

29 lines
751 B
Bash
Raw Permalink Normal View History

2025-04-20 11:29:53 -07:00
#!/bin/bash
# Change directory to root Server directory for correct Docker Context
cd "$(dirname "$0")"
cd ../..
# Define service names and their corresponding Dockerfiles in parallel arrays
2025-09-22 13:26:45 -07:00
services=("uptime_client" "uptime_mongo" "uptime_server")
dockerfiles=(
"./docker/dev/client.Dockerfile"
"./docker/dev/mongoDB.Dockerfile"
"./docker/dev/server.Dockerfile"
2025-04-20 11:29:53 -07:00
)
# Loop through each service and build the corresponding image
for i in "${!services[@]}"; do
service="${services[$i]}"
dockerfile="${dockerfiles[$i]}"
2025-04-20 11:29:53 -07:00
docker build -f "$dockerfile" -t "$service" .
# Check if the build succeeded
2025-04-20 11:29:53 -07:00
if [ $? -ne 0 ]; then
echo "Error building $service image. Exiting..."
exit 1
fi
done
echo "All images built successfully"