Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions compose/local/minio/init.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#!/bin/sh
# Stop on the first error so a failed bucket setup fails this container instead of passing silently.
set -e
Comment thread
mihow marked this conversation as resolved.

# Create a default bucket
# /usr/bin/mc set alias minio "${MINIO_ENDPOINT}" "${MINIO_ROOT_USER}" "${MINIO_ROOT_PASSWORD}"
/usr/bin/mc config host add local "${MINIO_ENDPOINT}" "${MINIO_ROOT_USER}" "${MINIO_ROOT_PASSWORD}"
# Create the default buckets. Current mc releases dropped `mc config host add`, so use `mc alias set`.
/usr/bin/mc alias set local "${MINIO_ENDPOINT}" "${MINIO_ROOT_USER}" "${MINIO_ROOT_PASSWORD}"
/usr/bin/mc mb local/"${MINIO_DEFAULT_BUCKET}" --ignore-existing
/usr/bin/mc mb local/"${MINIO_TEST_BUCKET}" --ignore-existing

# Give it public read access
/usr/bin/mc anonymous set public local/"${MINIO_DEFAULT_BUCKET}"
/usr/bin/mc anonymous set public local/"${MINIO_TEST_BUCKET}"

exit 0
30 changes: 20 additions & 10 deletions docker-compose.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,19 @@ services:
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
- postgres
- redis
- minio-init
- ml_backend
- rabbitmq
- nats
postgres:
condition: service_started
redis:
condition: service_started
# Wait for bucket setup to succeed so a failure stops the job here, not in later tests.
minio-init:
condition: service_completed_successfully
ml_backend:
condition: service_started
rabbitmq:
condition: service_started
nats:
condition: service_started
env_file:
- ./.envs/.ci/.django
- ./.envs/.ci/.postgres
Expand Down Expand Up @@ -63,8 +70,11 @@ services:
- ./.envs/.ci/.django

minio:
image: quay.io/minio/minio:RELEASE.2024-11-07T00-52-20Z
command: minio server --console-address ":9001" /data
# MinIO no longer publishes pullable images (Docker Hub and quay.io both require a login).
# This image bundles the server, mc and a shell, so minio-init reuses it. Pinned by digest;
# to bump: docker pull cgr.dev/chainguard/minio:latest, then copy RepoDigests from docker image inspect.
image: cgr.dev/chainguard/minio:latest@sha256:6a1d0b45c8669726bba580ced0bfa4cb9fdeed1ed636dfabd81d1577beb6937b
command: server --console-address ":9001" /data
volumes:
- "minio_ci_data:/data"
env_file:
Expand All @@ -76,15 +86,15 @@ services:
retries: 5

minio-init:
image: quay.io/minio/mc:RELEASE.2025-03-12T17-29-24Z
image: cgr.dev/chainguard/minio:latest@sha256:6a1d0b45c8669726bba580ced0bfa4cb9fdeed1ed636dfabd81d1577beb6937b
env_file:
- ./.envs/.ci/.django
depends_on:
minio:
condition: service_healthy
volumes:
- ./compose/local/minio/init.sh:/etc/minio/init.sh
entrypoint: /etc/minio/init.sh
entrypoint: ["/bin/sh", "/etc/minio/init.sh"]

ml_backend:
build:
Expand Down
38 changes: 26 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,19 @@ services:
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
- postgres
- redis
- nats
- minio-init
- ml_backend
- rabbitmq
postgres:
condition: service_started
redis:
condition: service_started
nats:
condition: service_started
# Wait for bucket setup to succeed, so Django never starts against missing buckets.
minio-init:
condition: service_completed_successfully
ml_backend:
condition: service_started
rabbitmq:
condition: service_started
volumes:
- .:/app:z
env_file:
Expand Down Expand Up @@ -139,8 +146,13 @@ services:
- antenna_network

minio:
image: quay.io/minio/minio:RELEASE.2024-11-07T00-52-20Z
command: minio server --console-address ":9001" /data
# MinIO no longer publishes pullable images (Docker Hub and quay.io both require a login).
# This image bundles the server, mc and a shell, so minio-init reuses it. Pinned by digest;
# to bump: docker pull cgr.dev/chainguard/minio:latest, then copy RepoDigests from docker image inspect.
image: cgr.dev/chainguard/minio:latest@sha256:6a1d0b45c8669726bba580ced0bfa4cb9fdeed1ed636dfabd81d1577beb6937b
command: server --console-address ":9001" /data
# Existing dev volumes were written by the old image as root; the new one defaults to a non-root user.
user: root
volumes:
- "minio_data:/data"
env_file:
Expand All @@ -165,15 +177,17 @@ services:
- minio

minio-init:
image: quay.io/minio/mc:RELEASE.2025-03-12T17-29-24Z
image: cgr.dev/chainguard/minio:latest@sha256:6a1d0b45c8669726bba580ced0bfa4cb9fdeed1ed636dfabd81d1577beb6937b
env_file:
- ./.envs/.local/.django
depends_on:
- minio
- minio-proxy
minio:
condition: service_healthy
minio-proxy:
condition: service_started
volumes:
- ./compose/local/minio/init.sh:/etc/minio/init.sh
entrypoint: /etc/minio/init.sh
entrypoint: ["/bin/sh", "/etc/minio/init.sh"]

ml_backend:
build:
Expand Down
Loading