From 8c76bc412708d9bf8f8bd96bf5c94aea1398cfad Mon Sep 17 00:00:00 2001 From: Denys Chura Date: Wed, 2 Oct 2024 18:41:13 +0300 Subject: [PATCH] Some improvements to `minio` config - Add waiting for `minio` in to `createbuckets` entrypoint; - Replace `MINIO_ACCESS_KEY` -> `MINIO_ROOT_USER` and `MINIO_SECRET_KEY` -> `MINIO_ROOT_PASSWORD` in `minio` environment to fix deprecation warning; - Update root `minio` user name/password to not be same as default to avoid "detected default credentials" warning which can hide configuration issue. --- cookiecutter.json | 4 ++-- {{ cookiecutter.project_slug }}/docker/docker-compose.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index f40b80e..7184416 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -10,7 +10,7 @@ "__db_name": "{{ cookiecutter.project_slug | lower() }}_db", "__db_user": "{{ cookiecutter.project_slug | lower() }}_user", "__db_password": "{{ cookiecutter.project_slug | lower() }}_password", - "__minio_access_key": "minioadmin", - "__minio_secret_key": "minioadmin", + "__minio_access_key": "minioadminuser", + "__minio_secret_key": "minioadminpassword", "__minio_bucket_name": "storage" } diff --git a/{{ cookiecutter.project_slug }}/docker/docker-compose.yml b/{{ cookiecutter.project_slug }}/docker/docker-compose.yml index d9ccb29..c91c63e 100644 --- a/{{ cookiecutter.project_slug }}/docker/docker-compose.yml +++ b/{{ cookiecutter.project_slug }}/docker/docker-compose.yml @@ -57,8 +57,8 @@ services: - ${LOCAL_IP:-127.0.0.1}:${MINIO_LOCAL_PORT:-9000}:9000 - ${LOCAL_IP:-127.0.0.1}:${MINIO_CONSOLE_LOCAL_PORT:-9001}:9001 environment: - MINIO_ACCESS_KEY: {{ cookiecutter.__minio_access_key }} - MINIO_SECRET_KEY: {{ cookiecutter.__minio_secret_key }} + MINIO_ROOT_USER: {{ cookiecutter.__minio_access_key }} + MINIO_ROOT_PASSWORD: {{ cookiecutter.__minio_secret_key }} volumes: - minio_data:/data command: [ "server", "--console-address", ":9001", "/data" ] @@ -68,7 +68,7 @@ services: - minio entrypoint: > /bin/sh -c " - /usr/bin/mc alias set myminio http://minio:9000 {{ cookiecutter.__minio_access_key }} {{ cookiecutter.__minio_secret_key }}; + until (/usr/bin/mc alias set myminio http://minio:9000 {{ cookiecutter.__minio_access_key }} {{ cookiecutter.__minio_secret_key }}) do echo '...waiting...' && sleep 1; done; /usr/bin/mc mb --ignore-existing myminio/{{ cookiecutter.__minio_bucket_name }}; /usr/bin/mc anonymous set download myminio/{{ cookiecutter.__minio_bucket_name }}; exit 0;