diff --git a/.env b/.env index 73e2746..b393877 100644 --- a/.env +++ b/.env @@ -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" diff --git a/.gitignore b/.gitignore index 1733f9a..bd9a4e0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /etc/ /storage/ /docker-compose.override.yml +/repos/ diff --git a/docker-compose.any-sync-admin.yml b/docker-compose.any-sync-admin.yml new file mode 100644 index 0000000..d32f241 --- /dev/null +++ b/docker-compose.any-sync-admin.yml @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index 1955937..5963030 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: diff --git a/docker-generateconfig/etc/admin.yml b/docker-generateconfig/etc/admin.yml index cd86a49..25405cc 100644 --- a/docker-generateconfig/etc/admin.yml +++ b/docker-generateconfig/etc/admin.yml @@ -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% diff --git a/docker-generateconfig/processing.sh b/docker-generateconfig/processing.sh index 1b25a43..8a2b841 100755 --- a/docker-generateconfig/processing.sh +++ b/docker-generateconfig/processing.sh @@ -54,6 +54,7 @@ done # Replace other placeholders placeholders=( "MONGO_CONNECT" + "MONGO_URL" "REDIS_URL" "MINIO_PORT" "MINIO_BUCKET"