diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7834613a..5660a2d3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -54,10 +54,17 @@ jobs: sleep 2 done - - name: Wait for MinIO bucket initialization + - name: Wait for the MinIO test bucket run: | - echo "Waiting for MinIO bucket initialization..." - docker wait bowphp_minio_init || true + echo "Waiting for the public 'tests' bucket on MinIO..." + for i in {1..30}; do + if [ "$(curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:9000/tests/)" = "200" ]; then + echo "MinIO bucket is ready!" + break + fi + echo "Waiting for MinIO... ($i/30)" + sleep 2 + done - name: Cache Composer packages id: composer-cache diff --git a/docker-compose.yml b/docker-compose.yml index c7113c82..d992ccce 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -146,7 +146,12 @@ services: retries: 5 minio: container_name: bowphp_minio - image: minio/minio + # MinIO removed its images from Docker Hub (minio/minio and minio/mc + # now return "object not found") and quay.io requires a login, which + # broke `docker compose up` in CI. Bitnami's frozen legacy archive is + # the drop-in: same API and ports, and it creates the test bucket + # itself through MINIO_DEFAULT_BUCKETS, so no `mc` init container. + image: bitnamilegacy/minio:latest restart: unless-stopped ports: - "9000:9000" @@ -154,29 +159,15 @@ services: environment: MINIO_ROOT_USER: minioadmin MINIO_ROOT_PASSWORD: minioadmin - command: server /data --console-address ":9001" + # bucket:policy — a public "tests" bucket, as minio-init used to create. + MINIO_DEFAULT_BUCKETS: "tests:public" networks: - bowphp_network healthcheck: - test: ["CMD", "mc", "alias", "set", "local", "http://localhost:9000", "minioadmin", "minioadmin"] + test: ["CMD", "curl", "-sf", "http://localhost:9000/minio/health/ready"] interval: 10s timeout: 5s retries: 5 - minio-init: - container_name: bowphp_minio_init - image: minio/mc - depends_on: - minio: - condition: service_healthy - entrypoint: > - /bin/sh -c " - mc alias set local http://minio:9000 minioadmin minioadmin; - mc mb --ignore-existing local/tests; - mc anonymous set public local/tests; - exit 0; - " - networks: - - bowphp_network zookeeper: container_name: bowphp_zookeeper image: confluentinc/cp-zookeeper:7.5.0