From 2d5a878cfea255f4c0665ede523e7abb1cf53b6b Mon Sep 17 00:00:00 2001 From: Jonathan Gotti Date: Wed, 7 May 2025 09:11:24 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Refacto=20minio=20template?= =?UTF-8?q?=20(#65)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ♻️ Refacto minio template - add random password generation - forward port 9000 and expose 9001 through traefik - add some comments to add some volume setting info * 🔧 Remove domain config for port 9000 - 🐛 Fix redirection loop by adding MINIO_BROWSER_REDIRECT=false --- blueprints/minio/docker-compose.yml | 20 ++++++++++++++++++-- blueprints/minio/template.toml | 10 +++++----- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/blueprints/minio/docker-compose.yml b/blueprints/minio/docker-compose.yml index 4b24bbc..b8e91df 100644 --- a/blueprints/minio/docker-compose.yml +++ b/blueprints/minio/docker-compose.yml @@ -3,11 +3,27 @@ services: minio: image: minio/minio volumes: + # by default, the MinIO container will use a volume named minio-data + # to store its data. This volume is created automatically by Docker. + # If you want to use a local directory instead, uncomment the line below + # and specify the path to your local directory. + # (be warned that ../files is pointing to a subdirectory of /etc/dokploy/compose in dokploy) + # - ../files/minio-data:/data + # if you uncommented the line above, comment the line below and the volumes section at the end - minio-data:/data environment: - - MINIO_ROOT_USER=minioadmin - - MINIO_ROOT_PASSWORD=minioadmin123 + - MINIO_ROOT_USER=${MINIO_ROOT_USER} + - MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD} + - MINIO_BROWSER_REDIRECT_URL=${MINIO_BROWSER_REDIRECT_URL} command: server /data --console-address ":9001" + ports: + # by default, the MinIO container will use port 9000 to expose its API + # and port 9001 to expose its web console + # minio requires port to be specified when making a request to the API + - 9000:9000 + expose: + - 9001 +# comment the line below if you specified a local directory in the volumes section of the minio service volumes: minio-data: diff --git a/blueprints/minio/template.toml b/blueprints/minio/template.toml index 6c3367d..ae6f177 100644 --- a/blueprints/minio/template.toml +++ b/blueprints/minio/template.toml @@ -3,7 +3,6 @@ main_domain = "${domain}" api_domain = "${domain}" [config] -env = {} mounts = [] [[config.domains]] @@ -11,7 +10,8 @@ serviceName = "minio" port = 9_001 host = "${main_domain}" -[[config.domains]] -serviceName = "minio" -port = 9_000 -host = "${api_domain}" +[config.env] +MINIO_ROOT_USER = "minioadmin" +MINIO_ROOT_PASSWORD = "${password:16}" +MINIO_BROWSER_REDIRECT_URL = "http://${main_domain}" +MINIO_BROWSER_REDIRECT = "false"