mirror of
https://github.com/anyproto/any-sync-dockercompose.git
synced 2025-06-08 05:47:03 +09:00
added any-sync-admin
This commit is contained in:
parent
4bce1cbe3a
commit
93362b87ee
5 changed files with 36 additions and 4 deletions
7
.env
7
.env
|
@ -8,6 +8,7 @@ ANY_SYNC_NODE_VERSION=latest
|
|||
ANY_SYNC_FILENODE_VERSION=latest
|
||||
ANY_SYNC_COORDINATOR_VERSION=latest
|
||||
ANY_SYNC_CONSENSUSNODE_VERSION=latest
|
||||
ANY_SYNC_ADMIN_VERSION=latest
|
||||
|
||||
MONGO_VERSION=7.0.2
|
||||
REDIS_VERSION=7.2.0-v6
|
||||
|
@ -58,5 +59,9 @@ MONGO_1_PORT=27001
|
|||
MONGO_2_PORT=27002
|
||||
MONGO_3_PORT=27003
|
||||
MONGO_CONNECT=mongodb://mongo-1:${MONGO_1_PORT},mongo-2:${MONGO_2_PORT},mongo-3:${MONGO_3_PORT}
|
||||
REDIS_HOST=redis
|
||||
REDIS_PORT=6379
|
||||
REDIS_URL="redis://redis:${REDIS_PORT}?dial_timeout=3&read_timeout=6s"
|
||||
REDIS_URL="redis://${REDIS_HOST}:${REDIS_PORT}?dial_timeout=3&read_timeout=6s"
|
||||
|
||||
ANY_SYNC_ADMIN_HOST=0.0.0.0
|
||||
ANY_SYNC_ADMIN_PORT=5000
|
||||
|
|
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -1,3 +1,3 @@
|
|||
etc/
|
||||
storage/
|
||||
docker-compose.override.yml
|
||||
/etc/
|
||||
/storage/
|
||||
/docker-compose.override.yml
|
||||
|
|
|
@ -204,3 +204,13 @@ services:
|
|||
memory: 500M
|
||||
restart: on-failure
|
||||
command: bash -c "sleep 15; /bin/any-sync-consensusnode -c /etc/any-sync-consensusnode/config.yml"
|
||||
|
||||
any-sync-admin:
|
||||
image: "ghcr.io/anyproto/any-sync-admin:${ANY_SYNC_ADMIN_VERSION}"
|
||||
depends_on:
|
||||
- any-sync-coordinator
|
||||
ports:
|
||||
- "80:${ANY_SYNC_ADMIN_PORT}"
|
||||
volumes:
|
||||
- ./etc/any-sync-admin/:/etc/any-sync-admin/
|
||||
restart: on-failure
|
||||
|
|
9
docker-generateconfig/etc/admin.yml
Normal file
9
docker-generateconfig/etc/admin.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
listen:
|
||||
host: %ANY_SYNC_ADMIN_HOST%
|
||||
port: %ANY_SYNC_ADMIN_PORT%
|
||||
mongo:
|
||||
url: %MONGO_CONNECT%
|
||||
redis:
|
||||
host: %REDIS_HOST%
|
||||
port: %REDIS_PORT%
|
|
@ -39,6 +39,10 @@ cat "${network_file}" tmp-etc/common.yml generateconfig/account5.yml tmp-etc/con
|
|||
# Copy network file to coordinator directory
|
||||
cp "generateconfig/nodes.yml" "${dest_path}/any-sync-coordinator/network.yml"
|
||||
|
||||
# Generate any-sync-admin config
|
||||
mkdir -p ${dest_path}/any-sync-admin
|
||||
cp "tmp-etc/admin.yml" ${dest_path}/any-sync-admin/config.yml
|
||||
|
||||
# Replace placeholders in config files
|
||||
for node_type in node_1 node_2 node_3 coordinator filenode consensusnode; do
|
||||
addresses="ANY_SYNC_${node_type^^}_ADDRESSES"
|
||||
|
@ -56,6 +60,10 @@ placeholders=(
|
|||
"ANY_SYNC_COORDINATOR_FILE_LIMIT_DEFAULT"
|
||||
"ANY_SYNC_COORDINATOR_FILE_LIMIT_ALPHA_USERS"
|
||||
"ANY_SYNC_COORDINATOR_FILE_LIMIT_NIGHTLY_USERS"
|
||||
"ANY_SYNC_ADMIN_HOST"
|
||||
"ANY_SYNC_ADMIN_PORT"
|
||||
"REDIS_HOST"
|
||||
"REDIS_PORT"
|
||||
)
|
||||
for placeholder in "${placeholders[@]}"; do
|
||||
perl -i -pe "s|%${placeholder}%|${!placeholder}|g" "${network_file}" "${dest_path}/"/*/*.yml
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue