feat: 优化 MinIO 安装包

This commit is contained in:
wanghe-fit2cloud 2024-03-07 11:46:14 +08:00
parent 1b838b65f5
commit 73554d0166
4 changed files with 22 additions and 57 deletions

View File

@ -1,12 +1,5 @@
additionalProperties: additionalProperties:
formFields: formFields:
- default: "/home/minio"
edit: true
envKey: MINIO_ROOT_PATH
labelEn: Data persistence root path
labelZh: 数据持久化 根路径
required: true
type: text
- default: minio - default: minio
envKey: PANEL_MINIO_ROOT_USER envKey: PANEL_MINIO_ROOT_USER
labelEn: User labelEn: User
@ -23,23 +16,25 @@ additionalProperties:
required: true required: true
rule: paramComplexity rule: paramComplexity
type: password type: password
- default: "12h" - default: 9000
envKey: MINIO_BROWSER_SESSION_DURATION
labelEn: Session duration
labelZh: 会话持续时间 (s/秒 m/分钟 h/小时 d/天)
required: true
type: text
- default: "9001"
envKey: PANEL_APP_PORT_HTTP envKey: PANEL_APP_PORT_HTTP
labelEn: Port labelEn: Port
labelZh: 端口 labelZh: 端口
required: true required: true
type: text rule: paramPort
- default: "9000" type: number
- default: 9001
envKey: PANEL_APP_PORT_API envKey: PANEL_APP_PORT_API
labelEn: Port labelEn: Port
labelZh: API 端口 labelZh: API 端口
required: true required: true
rule: paramPort
type: number
- default: "12h"
envKey: MINIO_BROWSER_SESSION_DURATION
labelEn: Session duration
labelZh: 会话持续时间 (s/秒 m/分钟 h/小时 d/天)
required: true
type: text type: text
- default: "on" - default: "on"
envKey: MINIO_BROWSER envKey: MINIO_BROWSER

View File

@ -1,9 +1,4 @@
version: '3' version: '3'
networks:
1panel-network:
external: true
services: services:
minio: minio:
image: minio/minio:RELEASE.2024-02-26T09-33-48Z image: minio/minio:RELEASE.2024-02-26T09-33-48Z
@ -26,15 +21,18 @@ services:
max-size: "5M" max-size: "5M"
max-file: "10" max-file: "10"
driver: json-file driver: json-file
networks:
- 1panel-network
volumes:
- ./data:/data
- ./certs:/root/.minio/certs
labels:
createdBy: "Apps"
healthcheck: healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9000/minio/health/live" ] test: [ "CMD", "curl", "-f", "http://localhost:9000/minio/health/live" ]
interval: 30s interval: 30s
timeout: 20s timeout: 20s
retries: 3 retries: 3
networks: networks:
- 1panel-network 1panel-network:
volumes: external: true
- ${MINIO_ROOT_PATH}/data:/data
- ${MINIO_ROOT_PATH}/certs:/root/.minio/certs
labels:
createdBy: "Apps"

View File

@ -1,16 +0,0 @@
#!/bin/bash
if [ -f .env ]; then
source .env
mkdir -p "$MINIO_ROOT_PATH"
mkdir -p "$MINIO_ROOT_PATH/data"
mkdir -p "$MINIO_ROOT_PATH/certs"
echo "Directories set successfully."
else
echo "Error: .env file not found."
exit 1
fi

View File

@ -1,18 +1,6 @@
#!/bin/bash #!/bin/bash
if [[ -f ./.env ]]; then if [[ -f ./.env ]]; then
source .env
mkdir -p "$MINIO_ROOT_PATH"
mkdir -p "$MINIO_ROOT_PATH/data"
mkdir -p "$MINIO_ROOT_PATH/certs"
if grep -q "MINIO_ROOT_PATH" ./.env; then
echo "MINIO_ROOT_PATH 已存在"
else
echo 'MINIO_ROOT_PATH="/home/minio"' >> ./.env
echo 'Copy data to /home/minio'
cp -r ./data /home/minio
fi
if grep -q "MINIO_BROWSER_SESSION_DURATION" ./.env; then if grep -q "MINIO_BROWSER_SESSION_DURATION" ./.env; then
echo "MINIO_BROWSER_SESSION_DURATION 已存在" echo "MINIO_BROWSER_SESSION_DURATION 已存在"
@ -20,7 +8,7 @@ if [[ -f ./.env ]]; then
echo 'MINIO_BROWSER_SESSION_DURATION="12h"' >> ./.env echo 'MINIO_BROWSER_SESSION_DURATION="12h"' >> ./.env
fi fi
if grep -q "MINIO_BROWSER" ./.env; then if grep -q "MINIO_BROWSER=" ./.env; then
echo "MINIO_BROWSER 已存在" echo "MINIO_BROWSER 已存在"
else else
echo 'MINIO_BROWSER="on"' >> ./.env echo 'MINIO_BROWSER="on"' >> ./.env