11#! /usr/bin/env bash
22set -euo pipefail
33
4+ # Container runtime (docker or podman) - can be set via environment variable
5+ CONTAINER_RUNTIME=" ${CONTAINER_RUNTIME:- docker} "
6+
47# Colors for output
58RED=' \033[0;31m'
69GREEN=' \033[0;32m'
@@ -111,14 +114,20 @@ check_prerequisites() {
111114
112115 local missing_deps=()
113116
114- # Check Docker
115- if ! command -v docker & > /dev/null; then
116- missing_deps+=(" docker " )
117+ # Check container runtime (docker or podman)
118+ if ! command -v " $CONTAINER_RUNTIME " & > /dev/null; then
119+ missing_deps+=(" $CONTAINER_RUNTIME " )
117120 fi
118121
119- # Check Docker Compose
120- if ! command -v docker compose & > /dev/null && ! command -v docker-compose & > /dev/null; then
121- missing_deps+=(" docker-compose" )
122+ # Check compose command
123+ if [ " $CONTAINER_RUNTIME " = " podman" ]; then
124+ if ! command -v podman compose & > /dev/null && ! command -v podman-compose & > /dev/null; then
125+ missing_deps+=(" podman-compose or podman compose plugin" )
126+ fi
127+ else
128+ if ! command -v docker compose & > /dev/null && ! command -v docker-compose & > /dev/null; then
129+ missing_deps+=(" docker-compose" )
130+ fi
122131 fi
123132
124133 # Check Make
@@ -195,7 +204,7 @@ download_models() {
195204
196205# Function to start services
197206start_services () {
198- info_msg " 🐳 Starting Docker services..."
207+ info_msg " 🐳 Starting container services (using $CONTAINER_RUNTIME ) ..."
199208 echo
200209
201210 # Start docker-compose services (runs in detached mode via Makefile)
@@ -204,7 +213,7 @@ start_services() {
204213 # - Dashboard build from Dockerfile (Go compilation can take 5-10 minutes)
205214 # - Network/system variations
206215 # Save output to log file for debugging
207- if timeout 600 make docker-compose-up 2>&1 | tee /tmp/docker-compose-output.log; then
216+ if timeout 600 make docker-compose-up CONTAINER_RUNTIME= " $CONTAINER_RUNTIME " 2>&1 | tee /tmp/docker-compose-output.log; then
208217 success_msg " ✅ Docker compose command completed!"
209218 echo " Output saved to: /tmp/docker-compose-output.log"
210219 else
@@ -240,17 +249,18 @@ wait_for_services() {
240249
241250 # Check each critical service
242251 for service in " ${critical_services[@]} " ; do
243- if ! docker ps --filter " name=$service " --filter " health=healthy" --format " {{.Names}}" | grep -q " $service " 2> /dev/null; then
252+ if ! " $CONTAINER_RUNTIME " ps --filter " name=$service " --filter " health=healthy" --format " {{.Names}}" | grep -q " $service " 2> /dev/null; then
244253 all_healthy=false
245254 unhealthy_services=" $unhealthy_services $service "
246255 fi
247256 done
248257
249258 # Check for any exited/failed containers
250- local failed_containers=$( docker ps -a --filter " status=exited" --format " {{.Names}}" 2> /dev/null)
259+ local failed_containers
260+ failed_containers=$( " $CONTAINER_RUNTIME " ps -a --filter " status=exited" --format " {{.Names}}" 2> /dev/null)
251261 if [ -n " $failed_containers " ]; then
252262 error_msg " ❌ Some containers failed to start: $failed_containers "
253- info_msg " 📋 Check logs with: docker compose logs $failed_containers "
263+ info_msg " 📋 Check logs with: $CONTAINER_RUNTIME compose logs $failed_containers "
254264 return 1
255265 fi
256266
@@ -259,7 +269,7 @@ wait_for_services() {
259269 echo
260270 # Show status of all containers
261271 section_header " 📊 Container Status:"
262- docker ps --format " table {{.Names}}\t{{.Status}}" | grep -E " NAMES|semantic-router|envoy|dashboard|prometheus|grafana|jaeger|openwebui|pipelines|llm-katan"
272+ " $CONTAINER_RUNTIME " ps --format " table {{.Names}}\t{{.Status}}" | grep -E " NAMES|semantic-router|envoy|dashboard|prometheus|grafana|jaeger|openwebui|pipelines|llm-katan"
263273 echo
264274 return 0
265275 fi
@@ -274,8 +284,8 @@ wait_for_services() {
274284 done
275285
276286 info_msg " ⚠️ Timeout: Services are starting but not all are healthy yet."
277- print_color " $WHITE " " 📋 Check status with: docker ps"
278- print_color " $WHITE " " 📋 View logs with: docker compose logs -f"
287+ print_color " $WHITE " " 📋 Check status with: $CONTAINER_RUNTIME ps"
288+ print_color " $WHITE " " 📋 View logs with: $CONTAINER_RUNTIME compose logs -f"
279289 return 1
280290}
281291
@@ -295,10 +305,10 @@ show_service_info() {
295305 echo
296306 section_header " 🔧 Useful Commands:"
297307 echo
298- print_color " $WHITE " " • Check service status: docker compose ps"
299- print_color " $WHITE " " • View logs: docker compose logs -f"
300- print_color " $WHITE " " • Stop services: docker compose down"
301- print_color " $WHITE " " • Restart services: docker compose restart"
308+ print_color " $WHITE " " • Check service status: $CONTAINER_RUNTIME compose ps"
309+ print_color " $WHITE " " • View logs: $CONTAINER_RUNTIME compose logs -f"
310+ print_color " $WHITE " " • Stop services: $CONTAINER_RUNTIME compose down"
311+ print_color " $WHITE " " • Restart services: $CONTAINER_RUNTIME compose restart"
302312 echo
303313}
304314
@@ -355,7 +365,7 @@ main() {
355365 # Wait for services to be healthy
356366 if ! wait_for_services; then
357367 error_msg " ❌ Service health check failed or timed out!"
358- info_msg " 📋 You can check logs with: docker compose logs"
368+ info_msg " 📋 You can check logs with: $CONTAINER_RUNTIME compose logs"
359369 info_msg " 📋 Or continue manually if services are starting"
360370 exit 1
361371 fi
0 commit comments