1
0
Fork 0
mirror of https://github.com/anyproto/any-sync-dockercompose.git synced 2025-06-08 05:47:03 +09:00

added docker-compose.any-sync-admin.yml

fixed mongo url for any-sync-admin
This commit is contained in:
Grigory Efimov 2024-02-13 18:30:23 -03:00
parent 69003a237f
commit 62618c0741
No known key found for this signature in database
GPG key ID: 0A88C34DFA7FD939
6 changed files with 23 additions and 5 deletions

3
.env
View file

@ -59,6 +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}
MONGO_REPLICA_SET=rs0
MONGO_URL=${MONGO_CONNECT}/?replicaSet=${MONGO_REPLICA_SET}
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_URL="redis://${REDIS_HOST}:${REDIS_PORT}?dial_timeout=3&read_timeout=6s"

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
/etc/
/storage/
/docker-compose.override.yml
/repos/

View file

@ -0,0 +1,12 @@
version: "3.9"
services:
any-sync-admin:
image: localbuild-admin
build:
context: .
dockerfile: repos/any-sync-admin/Dockerfile
ssh:
- default
args:
REPO_DIR: repos/any-sync-admin/
command: python app.py

View file

@ -3,19 +3,19 @@ version: "3.9"
services:
mongo-1:
image: "mongo:${MONGO_VERSION}"
command: --replSet rs0 --port ${MONGO_1_PORT}
command: --replSet ${MONGO_REPLICA_SET} --port ${MONGO_1_PORT}
ports:
- "${MONGO_1_PORT}:${MONGO_1_PORT}"
volumes:
- ./storage/mongo-1/:/data/db
healthcheck:
test: test $$(echo "rs.initiate({_id:'rs0',members:[{_id:0,host:\"mongo-1:${MONGO_1_PORT}\"},{_id:1,host:\"mongo-2:${MONGO_2_PORT}\"},{_id:2,host:\"mongo-3:${MONGO_3_PORT}\"}]}).ok || rs.status().ok" | mongosh --port ${MONGO_1_PORT} --quiet) -eq 1
test: test $$(echo "rs.initiate({_id:'${MONGO_REPLICA_SET}',members:[{_id:0,host:\"mongo-1:${MONGO_1_PORT}\"},{_id:1,host:\"mongo-2:${MONGO_2_PORT}\"},{_id:2,host:\"mongo-3:${MONGO_3_PORT}\"}]}).ok || rs.status().ok" | mongosh --port ${MONGO_1_PORT} --quiet) -eq 1
interval: 10s
start_period: 30s
mongo-2:
image: "mongo:${MONGO_VERSION}"
command: --replSet rs0 --port ${MONGO_2_PORT}
command: --replSet ${MONGO_REPLICA_SET} --port ${MONGO_2_PORT}
ports:
- "${MONGO_2_PORT}:${MONGO_2_PORT}"
volumes:
@ -23,7 +23,7 @@ services:
mongo-3:
image: "mongo:${MONGO_VERSION}"
command: --replSet rs0 --port ${MONGO_3_PORT}
command: --replSet ${MONGO_REPLICA_SET} --port ${MONGO_3_PORT}
ports:
- "${MONGO_3_PORT}:${MONGO_3_PORT}"
volumes:

View file

@ -2,8 +2,9 @@
listen:
host: %ANY_SYNC_ADMIN_HOST%
port: %ANY_SYNC_ADMIN_PORT%
debug: True
mongo:
url: %MONGO_CONNECT%
url: %MONGO_URL%
redis:
host: %REDIS_HOST%
port: %REDIS_PORT%

View file

@ -54,6 +54,7 @@ done
# Replace other placeholders
placeholders=(
"MONGO_CONNECT"
"MONGO_URL"
"REDIS_URL"
"MINIO_PORT"
"MINIO_BUCKET"