.PHONY: build up down tools shell-linux shell-frontend clean validate

# Build all images
build:
	docker compose build

# Start containerised labs (2.3 and 2.4)
up:
	docker compose up -d
	docker compose ps

# Stop and remove containers (keep volumes)
down:
	docker compose down

# Stop and remove containers AND volumes (full reset)
clean:
	docker compose down -v

# Start the tools service interactively (Lab 2.3 step 3+)
tools:
	docker compose run --rm tools bash

# Shell into the Linux sandbox (Lab 2.4)
shell-linux:
	docker exec -it ch02-linux-sandbox bash

# Shell into the frontend container (Lab 2.3 isolation tests)
shell-frontend:
	docker exec -it ch02-frontend sh

# Validate compose syntax only (no image pull)
validate:
	docker compose config -q && echo "compose: OK"
