#!/bin/bash
# Check new container labels and test the site
echo "=== CONTAINERS ==="
docker ps -a --format '{{.Names}} {{.Status}} {{.Ports}}' | grep bjcuh
echo ""
echo "=== NEW CONTAINER LABELS (port refs) ==="
CID=$(docker ps -a --format '{{.Names}}' | grep bjcuh | grep -v old | head -1)
docker inspect "$CID" --format '{{json .Config.Labels}}' | tr ',' '\n' | grep -iE 'port|traefik.enable' | head -20
echo ""
echo "=== TEST LOCALHOST:80 ==="
curl -s -o /dev/null -w '%{http_code}' http://localhost/ 
echo ""
echo "=== TEST 87.106.131.211:80 ==="
curl -s -o /dev/null -w '%{http_code}' http://87.106.131.211/
