23 lines
662 B
Bash
Executable File
23 lines
662 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
# 🧹 1) Clean up any existing containers
|
|
for NAME in karel-simulator karel-redis; do
|
|
if docker ps -a --format '{{.Names}}' | grep -q "^${NAME}\$"; then
|
|
echo "🛑 Removing existing container '${NAME}'..."
|
|
docker rm -f "${NAME}" >/dev/null 2>&1 || true
|
|
fi
|
|
done
|
|
|
|
# 🚀 2) (Re)start both services in detached mode
|
|
echo "🚀 Starting multi-container application..."
|
|
# instead of: docker compose up -d
|
|
docker-compose up -d
|
|
|
|
# ✅ 3) Show status
|
|
echo
|
|
echo "✅ All containers are up:"
|
|
docker ps --filter "name=karel-" --format " • {{.Names}} ({{.Image}}) → {{.Ports}}"
|
|
echo
|
|
echo "🌐 Simulator: http://localhost:8080/"
|