35 lines
1.2 KiB
Bash
35 lines
1.2 KiB
Bash
set -euo pipefail
|
||
|
||
echo "===> Vérification du répertoire courant"
|
||
test -f docker-compose.yml || { echo "❌ docker-compose.yml introuvable ici"; exit 1; }
|
||
|
||
echo "===> Stop & clean (tous projets 'supersunday*')"
|
||
docker ps -a --format '{{.Names}}' | grep -E '^supersunday' || true
|
||
docker compose down --remove-orphans || true
|
||
|
||
echo "===> Kill conteneurs résiduels nommés 'supersunday*'"
|
||
for c in $(docker ps -a --format '{{.Names}}' | grep -E '^supersunday' || true); do
|
||
docker rm -f "$c" || true
|
||
done
|
||
|
||
echo "===> Ports 80 actuellement à l'écoute:"
|
||
sudo lsof -iTCP:80 -sTCP:LISTEN || true
|
||
|
||
echo "===> Build API (no-cache) + start DB & API"
|
||
docker compose build --no-cache api
|
||
docker compose up -d db api
|
||
|
||
echo "===> Statut:"
|
||
docker compose ps
|
||
|
||
echo "===> Logs API (10 dernières lignes):"
|
||
docker compose logs --tail=10 api
|
||
|
||
echo "===> Test santé depuis le conteneur API"
|
||
docker compose exec api sh -lc 'apk add --no-cache curl >/dev/null 2>&1 || true; curl -fsS http://localhost:4000/api/health || (echo "<KO>" && exit 1)'
|
||
|
||
echo "===> Test santé depuis l’hôte"
|
||
curl -fsS http://localhost/api/health || (echo "<KO host>" && exit 1)
|
||
|
||
echo "✅ OK: API UP sur http://localhost"
|