fix(compose): mark create-buckets as one-shot for up --wait (#510) #511

Merged
marcel merged 1 commits from fix/issue-510-compose-wait-oneshot-create-buckets into main 2026-05-11 17:00:00 +02:00

View File

@@ -86,6 +86,10 @@ services:
# runner container's CWD. See #506 + infra/minio/Dockerfile. # runner container's CWD. See #506 + infra/minio/Dockerfile.
build: build:
context: ./infra/minio context: ./infra/minio
# Declare one-shot intent so `docker compose up -d --wait` treats
# exited(0) as success rather than "not running, fail". Pair with
# backend's `service_completed_successfully` dependency below. See #510.
restart: "no"
depends_on: depends_on:
minio: minio:
condition: service_healthy condition: service_healthy
@@ -160,6 +164,12 @@ services:
condition: service_healthy condition: service_healthy
ocr-service: ocr-service:
condition: service_healthy condition: service_healthy
# Gate startup on the bucket bootstrap. Without this, backend
# starts in parallel with create-buckets and may race the policy
# bind. Also tells compose's `up -d --wait` that create-buckets
# is a one-shot that must complete successfully. See #510.
create-buckets:
condition: service_completed_successfully
# Bound to localhost only — Caddy fronts external traffic. # Bound to localhost only — Caddy fronts external traffic.
ports: ports:
- "127.0.0.1:${PORT_BACKEND}:8080" - "127.0.0.1:${PORT_BACKEND}:8080"