Skip to content

Commit

Permalink
Merge pull request #70 from anyproto/69-custom-storage-location
Browse files Browse the repository at this point in the history
custom storage location
  • Loading branch information
fb929 authored Jun 24, 2024
2 parents 9ab192e + ed0667d commit 9d7e067
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .env.common
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,5 @@ 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"

STORAGE_DIR="./storage"
27 changes: 15 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ services:
dockerfile: Dockerfile-generateconfig-anyconf
volumes:
- ./:/code
- "${STORAGE_DIR}:/code/storage"

# processing any-sync-* configs
generateconfig-processing:
Expand All @@ -19,6 +20,7 @@ services:
dockerfile: Dockerfile-generateconfig-processing
volumes:
- ./:/code
- "${STORAGE_DIR}:/code/storage"

mongo-1:
depends_on:
Expand All @@ -29,7 +31,7 @@ services:
ports:
- "${MONGO_1_PORT}:${MONGO_1_PORT}"
volumes:
- ./storage/mongo-1/:/data/db
- "${STORAGE_DIR}/mongo-1/:/data/db"
healthcheck:
test: test $$(mongosh --port ${MONGO_1_PORT} --quiet --eval "try {rs.initiate({_id:'${MONGO_REPLICA_SET}',members:[{_id:0,host:\"mongo-1:${MONGO_1_PORT}\"}]})} catch(e) {rs.status().ok}") -eq 1
interval: 10s
Expand All @@ -45,7 +47,7 @@ services:
ports:
- "${REDIS_PORT}:${REDIS_PORT}"
volumes:
- ./storage/redis/:/data/
- "${STORAGE_DIR}/redis/:/data/"
healthcheck:
test: [ "CMD", "redis-cli", "--raw", "-p", "${REDIS_PORT}", "incr", "ping" ]
interval: 10s
Expand All @@ -63,7 +65,7 @@ services:
- "${EXTERNAL_MINIO_PORT}:${MINIO_PORT}"
- "${EXTERNAL_MINIO_WEB_PORT}:${MINIO_WEB_PORT}"
volumes:
- ./storage/minio:/data
- "${STORAGE_DIR}/minio:/data"
healthcheck:
test: bash -c ':> /dev/tcp/127.0.0.1/${MINIO_PORT}' || exit 1
interval: 5s
Expand Down Expand Up @@ -113,7 +115,7 @@ services:
- 8005:8000
volumes:
- ./etc/any-sync-coordinator/:/etc/any-sync-coordinator/
- ./storage/networkStore/any-sync-coordinator/:/networkStore/
- "${STORAGE_DIR}/networkStore/any-sync-coordinator/:/networkStore/"
deploy:
resources:
limits:
Expand All @@ -136,7 +138,7 @@ services:
volumes:
- ./etc/any-sync-filenode/:/etc/any-sync-filenode/
- ./etc/.aws:/root/.aws:ro
- ./storage/networkStore/any-sync-filenode/:/networkStore/
- "${STORAGE_DIR}/networkStore/any-sync-filenode/:/networkStore/"
deploy:
resources:
limits:
Expand All @@ -155,8 +157,8 @@ services:
- 8001:8000
volumes:
- ./etc/any-sync-node-1/:/etc/any-sync-node/
- ./storage/any-sync-node-1/:/storage/
- ./storage/networkStore/any-sync-node-1/:/networkStore/
- "${STORAGE_DIR}/any-sync-node-1/:/storage/"
- "${STORAGE_DIR}/networkStore/any-sync-node-1/:/networkStore/"
deploy:
resources:
limits:
Expand All @@ -175,8 +177,8 @@ services:
- 8002:8000
volumes:
- ./etc/any-sync-node-2/:/etc/any-sync-node/
- ./storage/any-sync-node-2/:/storage/
- ./storage/networkStore/any-sync-node-2/:/networkStore/
- "${STORAGE_DIR}/any-sync-node-2/:/storage/"
- "${STORAGE_DIR}/networkStore/any-sync-node-2/:/networkStore/"
deploy:
resources:
limits:
Expand All @@ -195,8 +197,8 @@ services:
- 8003:8000
volumes:
- ./etc/any-sync-node-3/:/etc/any-sync-node/
- ./storage/any-sync-node-3/:/storage/
- ./storage/networkStore/any-sync-node-3/:/networkStore/
- "${STORAGE_DIR}/any-sync-node-3/:/storage/"
- "${STORAGE_DIR}/networkStore/any-sync-node-3/:/networkStore/"
deploy:
resources:
limits:
Expand All @@ -214,7 +216,7 @@ services:
- 8006:8000
volumes:
- ./etc/any-sync-consensusnode/:/etc/any-sync-consensusnode/
- ./storage/networkStore/any-sync-consensusnode/:/networkStore/
- "${STORAGE_DIR}/networkStore/any-sync-consensusnode/:/networkStore/"
deploy:
resources:
limits:
Expand All @@ -233,6 +235,7 @@ services:
- any-sync-node-3
volumes:
- ./:/code
- "${STORAGE_DIR}:/code/storage"
command: "tail -f /dev/null"
tty: true
healthcheck:
Expand Down

0 comments on commit 9d7e067

Please sign in to comment.