添加init.sh脚本,修改storage目录初始结构
This commit is contained in:
parent
bb150a7eee
commit
cee11adbdb
@ -77,18 +77,9 @@ services:
|
|||||||
rabbitmq:
|
rabbitmq:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
restart: true
|
restart: true
|
||||||
pgadmin:
|
|
||||||
condition: service_healthy
|
|
||||||
restart: true
|
|
||||||
portainer:
|
|
||||||
condition: service_healthy
|
|
||||||
restart: true
|
|
||||||
minio:
|
minio:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
restart: true
|
restart: true
|
||||||
mongo-express:
|
|
||||||
condition: service_healthy
|
|
||||||
restart: true
|
|
||||||
|
|
||||||
# 容器可视化管理应用,被nginx代理
|
# 容器可视化管理应用,被nginx代理
|
||||||
portainer:
|
portainer:
|
||||||
@ -99,11 +90,6 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- portainer:/data
|
- portainer:/data
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "curl", "-f", "http://localhost:9000"] # 假设Portainer的HTTP接口在9000端口
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 3
|
|
||||||
|
|
||||||
# postgres数据库管理应用,被nginx代理
|
# postgres数据库管理应用,被nginx代理
|
||||||
pgadmin:
|
pgadmin:
|
||||||
@ -118,11 +104,7 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- ${NETWORK_NAME}
|
- ${NETWORK_NAME}
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "curl", "-f", "http://localhost:80"] # 假设PgAdmin的HTTP接口在80端口
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 3
|
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
@ -146,11 +128,11 @@ services:
|
|||||||
command:
|
command:
|
||||||
- postgres
|
- postgres
|
||||||
- -c
|
- -c
|
||||||
- 'config_file=/etc/postgres/postgresql.conf'
|
- "config_file=/etc/postgres/postgresql.conf"
|
||||||
- -c
|
- -c
|
||||||
- 'hba_file=/etc/postgres/pg_hba.conf'
|
- "hba_file=/etc/postgres/pg_hba.conf"
|
||||||
- -c
|
- -c
|
||||||
- 'ident_file=/etc/postgres/pg_ident.conf'
|
- "ident_file=/etc/postgres/pg_ident.conf"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U hello"]
|
test: ["CMD-SHELL", "pg_isready -U hello"]
|
||||||
interval: 15s
|
interval: 15s
|
||||||
@ -172,11 +154,6 @@ services:
|
|||||||
ME_CONFIG_BASICAUTH_USERNAME: hello
|
ME_CONFIG_BASICAUTH_USERNAME: hello
|
||||||
ME_CONFIG_BASICAUTH_PASSWORD: helloworld
|
ME_CONFIG_BASICAUTH_PASSWORD: helloworld
|
||||||
ME_CONFIG_BASICAUTH: true
|
ME_CONFIG_BASICAUTH: true
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "curl", "-f", "http://localhost:8081"] # 假设mongo-express的HTTP接口在8081端口
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 3
|
|
||||||
depends_on:
|
depends_on:
|
||||||
mongo:
|
mongo:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
@ -197,9 +174,10 @@ services:
|
|||||||
- ./mongo/conf:/etc/mongo
|
- ./mongo/conf:/etc/mongo
|
||||||
networks:
|
networks:
|
||||||
- ${NETWORK_NAME}
|
- ${NETWORK_NAME}
|
||||||
command: ['mongod', '--config', '/etc/mongo/mongod.conf']
|
command: ["mongod", "--config", "/etc/mongo/mongod.conf"]
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "mongosh -u hello -p helloworld --eval \"db.stats().ok\""]
|
test:
|
||||||
|
["CMD-SHELL", 'mongosh -u hello -p helloworld --eval "db.stats().ok"']
|
||||||
interval: 20s
|
interval: 20s
|
||||||
retries: 5
|
retries: 5
|
||||||
start_period: 15s
|
start_period: 15s
|
||||||
@ -215,7 +193,7 @@ services:
|
|||||||
- ./redis/conf:/etc/redis
|
- ./redis/conf:/etc/redis
|
||||||
networks:
|
networks:
|
||||||
- ${NETWORK_NAME}
|
- ${NETWORK_NAME}
|
||||||
command: ['redis-server', '/etc/redis/redis.conf']
|
command: ["redis-server", "/etc/redis/redis.conf"]
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "redis-cli", "-a", "helloworld", "ping"]
|
test: ["CMD", "redis-cli", "-a", "helloworld", "ping"]
|
||||||
interval: 15s
|
interval: 15s
|
||||||
@ -238,9 +216,9 @@ services:
|
|||||||
command: server --console-address ':9001'
|
command: server --console-address ':9001'
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
|
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
|
||||||
interval: 15s
|
interval: 20s
|
||||||
retries: 3
|
retries: 5
|
||||||
start_period: 60s
|
start_period: 15s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
|
|
||||||
# rabbitmq消息队列服务
|
# rabbitmq消息队列服务
|
||||||
|
30
init.sh
Normal file
30
init.sh
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 获取脚本所在目录的绝对路径
|
||||||
|
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
|
||||||
|
|
||||||
|
# 切换工作目录到脚本所在目录
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
|
mkdir ./storage/minio
|
||||||
|
echo "mkdir ./storage/minio\n"
|
||||||
|
mkdir ./storage/mongo
|
||||||
|
echo "mkdir ./storage/mongo\n"
|
||||||
|
mkdir ./storage/pgadmin
|
||||||
|
echo "mkdir ./storage/pgadmin\n"
|
||||||
|
mkdir ./storage/portainer
|
||||||
|
echo "mkdir ./storage/portainer\n"
|
||||||
|
mkdir ./storage/postgres
|
||||||
|
echo "mkdir ./storage/postgres\n"
|
||||||
|
mkdir ./storage/rabbitmq
|
||||||
|
echo "mkdir ./storage/rabbitmq\n"
|
||||||
|
mkdir ./storage/redis
|
||||||
|
echo "mkdir ./storage/redis\n"
|
||||||
|
|
||||||
|
chmod 755 -R ./storage
|
||||||
|
echo "chmod 755 -R ./storage\n"
|
||||||
|
|
||||||
|
chown 5050:5050 ./storage/pgadmin
|
||||||
|
echo "chown 5050:5050 ./storage/pgadmin\n"
|
||||||
|
|
||||||
|
echo "All done. Now you can run 'docker compose up -d' to start the services.\n"
|
7
storage/.gitignore
vendored
Executable file
7
storage/.gitignore
vendored
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
/minio/*
|
||||||
|
/mongo/*
|
||||||
|
/pgadmin/*
|
||||||
|
/portainer/*
|
||||||
|
/postgres/*
|
||||||
|
/rabbitmq/*
|
||||||
|
/redis/*
|
2
storage/minio/.gitignore
vendored
2
storage/minio/.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
2
storage/mongo/.gitignore
vendored
2
storage/mongo/.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
2
storage/pgadmin/.gitignore
vendored
2
storage/pgadmin/.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
2
storage/portainer/.gitignore
vendored
2
storage/portainer/.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
8
storage/postgres/.gitignore
vendored
8
storage/postgres/.gitignore
vendored
@ -1,8 +0,0 @@
|
|||||||
pgdata/*
|
|
||||||
archived/*
|
|
||||||
backup/first/*
|
|
||||||
backup/*
|
|
||||||
!.gitignore
|
|
||||||
!pgdata
|
|
||||||
!backup/first
|
|
||||||
!archived
|
|
2
storage/rabbitmq/.gitignore
vendored
2
storage/rabbitmq/.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
2
storage/redis/.gitignore
vendored
2
storage/redis/.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
Loading…
Reference in New Issue
Block a user