1
0
Fork 0
mirror of https://github.com/anyproto/any-sync-dockercompose.git synced 2025-06-08 05:47:03 +09:00
any-sync-dockercompose/docker-compose.yml
2024-02-19 18:26:16 +03:00

217 lines
6.9 KiB
YAML

version: "3.9"
services:
mongo-1:
image: "mongo:${MONGO_VERSION}"
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:'${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 ${MONGO_REPLICA_SET} --port ${MONGO_2_PORT}
ports:
- "${MONGO_2_PORT}:${MONGO_2_PORT}"
volumes:
- ./storage/mongo-2/:/data/db
mongo-3:
image: "mongo:${MONGO_VERSION}"
command: --replSet ${MONGO_REPLICA_SET} --port ${MONGO_3_PORT}
ports:
- "${MONGO_3_PORT}:${MONGO_3_PORT}"
volumes:
- ./storage/mongo-3/:/data/db
redis:
image: "redis/redis-stack-server:${REDIS_VERSION}"
restart: always
command: redis-server --dir /data/ --appendonly yes --maxmemory 256mb --maxmemory-policy noeviction --protected-mode no --loadmodule /opt/redis-stack/lib/redisbloom.so
ports:
- "${REDIS_PORT}:${REDIS_PORT}"
volumes:
- ./storage/redis/:/data/
healthcheck:
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
interval: 10s
timeout: 30s
retries: 3
minio:
image: "minio/minio:${MINIO_VERSION}"
restart: always
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: "${AWS_ACCESS_KEY_ID}"
MINIO_ROOT_PASSWORD: "${AWS_SECRET_ACCESS_KEY}"
ports:
- "${MINIO_PORT}:9000"
- "${MINIO_WEB_PORT}:9001"
volumes:
- ./storage/minio:/data
healthcheck:
test: bash -c ':> /dev/tcp/127.0.0.1/9000' || exit 1
interval: 5s
timeout: 10s
retries: 3
networks:
default:
aliases:
- "${MINIO_BUCKET}.minio" # <bucket-name>.<endpoint-name>
create-bucket:
image: minio/mc:latest
environment:
MC_HOST_minio: http://${AWS_ACCESS_KEY_ID}:${AWS_SECRET_ACCESS_KEY}@minio:${MINIO_PORT}
restart: no
depends_on:
- minio
entrypoint:
- sh
- -c
- mc mb minio/${MINIO_BUCKET}
any-sync-coordinator_bootstrap:
image: "ghcr.io/anyproto/any-sync-coordinator:${ANY_SYNC_COORDINATOR_VERSION}"
depends_on:
- mongo-1
volumes:
- ./etc/any-sync-coordinator/:/etc/any-sync-coordinator/
restart: no
command: bash -c "sleep 10; /bin/any-sync-confapply -c /etc/any-sync-coordinator/config.yml -n /etc/any-sync-coordinator/network.yml -e"
any-sync-coordinator:
image: "ghcr.io/anyproto/any-sync-coordinator:${ANY_SYNC_COORDINATOR_VERSION}"
depends_on:
- any-sync-coordinator_bootstrap
ports:
- "${ANY_SYNC_COORDINATOR_PORT}:${ANY_SYNC_COORDINATOR_PORT}"
- "${ANY_SYNC_COORDINATOR_QUIC_PORT}:${ANY_SYNC_COORDINATOR_QUIC_PORT}"
- 8005:8000
volumes:
- ./etc/any-sync-coordinator/:/etc/any-sync-coordinator/
- ./storage/networkStore/any-sync-coordinator/:/networkStore/
deploy:
resources:
limits:
memory: 500M
restart: on-failure
command: bash -c "sleep 10; /bin/any-sync-coordinator -c /etc/any-sync-coordinator/config.yml"
any-sync-filenode:
image: "ghcr.io/anyproto/any-sync-filenode:${ANY_SYNC_FILENODE_VERSION}"
depends_on:
- redis
- minio
- any-sync-coordinator
ports:
- "${ANY_SYNC_FILENODE_PORT}:${ANY_SYNC_FILENODE_PORT}"
- "${ANY_SYNC_FILENODE_QUIC_PORT}:${ANY_SYNC_FILENODE_QUIC_PORT}"
- 8004:8000
volumes:
- ./etc/any-sync-filenode/:/etc/any-sync-filenode/
- ./etc/.aws:/root/.aws:ro
- ./storage/networkStore/any-sync-filenode/:/networkStore/
deploy:
resources:
limits:
memory: 500M
restart: on-failure
command: bash -c "sleep 15; /bin/any-sync-filenode -c /etc/any-sync-filenode/config.yml"
any-sync-node-1:
image: "ghcr.io/anyproto/any-sync-node:${ANY_SYNC_NODE_VERSION}"
depends_on:
- any-sync-coordinator
ports:
- "${ANY_SYNC_NODE_1_PORT}:${ANY_SYNC_NODE_1_PORT}"
- "${ANY_SYNC_NODE_1_QUIC_PORT}:${ANY_SYNC_NODE_1_QUIC_PORT}"
- 8081:8080
- 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/
deploy:
resources:
limits:
memory: 500M
restart: on-failure
command: bash -c "sleep 15; /bin/any-sync-node -c /etc/any-sync-node/config.yml"
any-sync-node-2:
image: "ghcr.io/anyproto/any-sync-node:${ANY_SYNC_NODE_VERSION}"
depends_on:
- any-sync-coordinator
ports:
- "${ANY_SYNC_NODE_2_PORT}:${ANY_SYNC_NODE_2_PORT}"
- "${ANY_SYNC_NODE_2_QUIC_PORT}:${ANY_SYNC_NODE_2_QUIC_PORT}"
- 8082:8080
- 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/
deploy:
resources:
limits:
memory: 500M
restart: on-failure
command: bash -c "sleep 15; /bin/any-sync-node -c /etc/any-sync-node/config.yml"
any-sync-node-3:
image: "ghcr.io/anyproto/any-sync-node:${ANY_SYNC_NODE_VERSION}"
depends_on:
- any-sync-coordinator
ports:
- "${ANY_SYNC_NODE_3_PORT}:${ANY_SYNC_NODE_3_PORT}"
- "${ANY_SYNC_NODE_3_QUIC_PORT}:${ANY_SYNC_NODE_3_QUIC_PORT}"
- 8083:8080
- 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/
deploy:
resources:
limits:
memory: 500M
restart: on-failure
command: bash -c "sleep 15; /bin/any-sync-node -c /etc/any-sync-node/config.yml"
any-sync-consensusnode:
image: "ghcr.io/anyproto/any-sync-consensusnode:${ANY_SYNC_CONSENSUSNODE_VERSION}"
depends_on:
- any-sync-coordinator
ports:
- "${ANY_SYNC_CONSENSUSNODE_PORT}:${ANY_SYNC_CONSENSUSNODE_PORT}"
- "${ANY_SYNC_CONSENSUSNODE_QUIC_PORT}:${ANY_SYNC_CONSENSUSNODE_QUIC_PORT}"
- 8006:8000
volumes:
- ./etc/any-sync-consensusnode/:/etc/any-sync-consensusnode/
- ./storage/networkStore/any-sync-consensusnode/:/networkStore/
deploy:
resources:
limits:
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:
- redis
- mongo-1
- mongo-2
- mongo-3
ports:
- "80:${ANY_SYNC_ADMIN_PORT}"
volumes:
- ./etc/any-sync-admin/:/etc/any-sync-admin/
restart: on-failure