mirror of
https://github.com/anyproto/any-sync-dockercompose.git
synced 2025-06-08 14:07:02 +09:00
commit
450d49c998
8 changed files with 60 additions and 20 deletions
|
@ -1,3 +1,3 @@
|
||||||
[default]
|
[default]
|
||||||
aws_access_key_id=testid
|
aws_access_key_id=minio_access_key
|
||||||
aws_secret_access_key=testkey
|
aws_secret_access_key=minio_secret_key
|
||||||
|
|
13
.env
13
.env
|
@ -1,6 +1,8 @@
|
||||||
AWS_ACCESS_KEY_ID=testid
|
AWS_ACCESS_KEY_ID=minio_access_key
|
||||||
AWS_SECRET_ACCESS_KEY=testkey
|
AWS_SECRET_ACCESS_KEY=minio_secret_key
|
||||||
AWS_PORT=4569
|
MINIO_BUCKET=minio-bucket
|
||||||
|
MINIO_PORT=9000
|
||||||
|
MINIO_WEB_PORT=9001
|
||||||
|
|
||||||
ANY_SYNC_NODE_VERSION=latest
|
ANY_SYNC_NODE_VERSION=latest
|
||||||
ANY_SYNC_FILENODE_VERSION=latest
|
ANY_SYNC_FILENODE_VERSION=latest
|
||||||
|
@ -9,7 +11,7 @@ ANY_SYNC_CONSENSUSNODE_VERSION=latest
|
||||||
|
|
||||||
MONGO_VERSION=7.0.2
|
MONGO_VERSION=7.0.2
|
||||||
REDIS_VERSION=7.2.0-v6
|
REDIS_VERSION=7.2.0-v6
|
||||||
S3_EMULATOR_VERSION=0.0.1
|
MINIO_VERSION=RELEASE.2024-01-16T16-07-38Z
|
||||||
|
|
||||||
EXTERNAL_LISTEN_HOST="127.0.0.1"
|
EXTERNAL_LISTEN_HOST="127.0.0.1"
|
||||||
|
|
||||||
|
@ -36,6 +38,9 @@ ANY_SYNC_COORDINATOR_PORT=1004
|
||||||
ANY_SYNC_COORDINATOR_ADDRESSES=${ANY_SYNC_COORDINATOR_HOST}:${ANY_SYNC_COORDINATOR_PORT}
|
ANY_SYNC_COORDINATOR_ADDRESSES=${ANY_SYNC_COORDINATOR_HOST}:${ANY_SYNC_COORDINATOR_PORT}
|
||||||
ANY_SYNC_COORDINATOR_QUIC_PORT=1014
|
ANY_SYNC_COORDINATOR_QUIC_PORT=1014
|
||||||
ANY_SYNC_COORDINATOR_QUIC_ADDRESSES=${ANY_SYNC_COORDINATOR_HOST}:${ANY_SYNC_COORDINATOR_QUIC_PORT}
|
ANY_SYNC_COORDINATOR_QUIC_ADDRESSES=${ANY_SYNC_COORDINATOR_HOST}:${ANY_SYNC_COORDINATOR_QUIC_PORT}
|
||||||
|
ANY_SYNC_COORDINATOR_FILE_LIMIT_DEFAULT=1099511627776
|
||||||
|
ANY_SYNC_COORDINATOR_FILE_LIMIT_ALPHA_USERS=1099511627776
|
||||||
|
ANY_SYNC_COORDINATOR_FILE_LIMIT_NIGHTLY_USERS=1099511627776
|
||||||
|
|
||||||
ANY_SYNC_FILENODE_HOST=any-sync-filenode
|
ANY_SYNC_FILENODE_HOST=any-sync-filenode
|
||||||
ANY_SYNC_FILENODE_PORT=1005
|
ANY_SYNC_FILENODE_PORT=1005
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -7,6 +7,8 @@ generate_config:
|
||||||
|
|
||||||
start: generate_config
|
start: generate_config
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
|
@echo "Done! Upload your self-hosted network configuration file ${CURDIR}/etc/client.yml into the client app"
|
||||||
|
@echo "See: https://doc.anytype.io/anytype-docs/data-and-security/self-hosting#switching-between-networks"
|
||||||
|
|
||||||
stop:
|
stop:
|
||||||
docker compose stop
|
docker compose stop
|
||||||
|
|
|
@ -3,6 +3,9 @@ Self-host for any-sync, designed for review and testing purposes.
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
> please don't use it for production!
|
> please don't use it for production!
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> Starting from release version v2.0.1, we have transitioned from the **s3-emulator** to **minio** as the data storage for any-sync-filenode. Please note that this change will result in the loss of any-sync-filenode data (stored at the path `./storage/s3_root`).
|
||||||
|
|
||||||
## Prepare
|
## Prepare
|
||||||
* install docker and docker-compose https://docs.docker.com/compose/install/linux/
|
* install docker and docker-compose https://docs.docker.com/compose/install/linux/
|
||||||
|
|
||||||
|
|
|
@ -38,17 +38,46 @@ services:
|
||||||
- "${REDIS_PORT}:${REDIS_PORT}"
|
- "${REDIS_PORT}:${REDIS_PORT}"
|
||||||
volumes:
|
volumes:
|
||||||
- ./storage/redis/:/data/
|
- ./storage/redis/:/data/
|
||||||
|
healthcheck:
|
||||||
|
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 30s
|
||||||
|
retries: 3
|
||||||
|
|
||||||
s3-emulator:
|
minio:
|
||||||
image: "stanislavt/s3-emulator:${S3_EMULATOR_VERSION}"
|
container_name: 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:
|
ports:
|
||||||
- "${AWS_PORT}:4569"
|
- "${MINIO_PORT}:9000"
|
||||||
|
- "${MINIO_WEB_PORT}:9001"
|
||||||
volumes:
|
volumes:
|
||||||
- ./storage/s3_root:/s3_root
|
- ./storage/minio:/data
|
||||||
|
healthcheck:
|
||||||
|
test: bash -c ':> /dev/tcp/127.0.0.1/9000' || exit 1
|
||||||
|
interval: 5s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
aliases:
|
aliases:
|
||||||
- s3-emulator.s3-emulator
|
- "${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:
|
any-sync-coordinator_bootstrap:
|
||||||
image: "ghcr.io/anyproto/any-sync-coordinator:${ANY_SYNC_COORDINATOR_VERSION}"
|
image: "ghcr.io/anyproto/any-sync-coordinator:${ANY_SYNC_COORDINATOR_VERSION}"
|
||||||
|
@ -81,7 +110,7 @@ services:
|
||||||
image: "ghcr.io/anyproto/any-sync-filenode:${ANY_SYNC_FILENODE_VERSION}"
|
image: "ghcr.io/anyproto/any-sync-filenode:${ANY_SYNC_FILENODE_VERSION}"
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- redis
|
||||||
- s3-emulator
|
- minio
|
||||||
- any-sync-coordinator
|
- any-sync-coordinator
|
||||||
ports:
|
ports:
|
||||||
- "${ANY_SYNC_FILENODE_PORT}:${ANY_SYNC_FILENODE_PORT}"
|
- "${ANY_SYNC_FILENODE_PORT}:${ANY_SYNC_FILENODE_PORT}"
|
||||||
|
|
|
@ -26,6 +26,6 @@ quic:
|
||||||
dialTimeoutSec: 10
|
dialTimeoutSec: 10
|
||||||
|
|
||||||
fileLimit:
|
fileLimit:
|
||||||
limitDefault: 1099511627776
|
limitDefault: %ANY_SYNC_COORDINATOR_FILE_LIMIT_DEFAULT%
|
||||||
limitAlphaUsers: 1099511627776
|
limitAlphaUsers: %ANY_SYNC_COORDINATOR_FILE_LIMIT_ALPHA_USERS%
|
||||||
limitNightlyUsers: 1099511627776
|
limitNightlyUsers: %ANY_SYNC_COORDINATOR_FILE_LIMIT_NIGHTLY_USERS%
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
s3Store:
|
s3Store:
|
||||||
bucket: s3-emulator
|
bucket: %MINIO_BUCKET%
|
||||||
indexBucket: s3-emulator
|
indexBucket: %MINIO_BUCKET%
|
||||||
maxThreads: 16
|
maxThreads: 16
|
||||||
profile: default
|
profile: default
|
||||||
region: eu-central-1
|
region: us-east-1
|
||||||
endpoint: http://s3-emulator:%AWS_PORT%
|
endpoint: http://minio:%MINIO_PORT%
|
||||||
|
forcePathStyle: true # 'true' for self-hosted S3 Object Storage
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
isCluster: false
|
isCluster: false
|
||||||
|
|
|
@ -48,7 +48,7 @@ for node_type in node_1 node_2 node_3 coordinator filenode consensusnode; do
|
||||||
done
|
done
|
||||||
|
|
||||||
# Replace other placeholders
|
# Replace other placeholders
|
||||||
placeholders=( "MONGO_CONNECT" "REDIS_URL" "AWS_PORT" )
|
placeholders=( "MONGO_CONNECT" "REDIS_URL" "MINIO_PORT" "MINIO_BUCKET" "ANY_SYNC_COORDINATOR_FILE_LIMIT_DEFAULT" "ANY_SYNC_COORDINATOR_FILE_LIMIT_ALPHA_USERS" "ANY_SYNC_COORDINATOR_FILE_LIMIT_NIGHTLY_USERS")
|
||||||
for placeholder in "${placeholders[@]}"; do
|
for placeholder in "${placeholders[@]}"; do
|
||||||
perl -i -pe "s|%${placeholder}%|${!placeholder}|g" "${network_file}" "${dest_path}/"/*/*.yml
|
perl -i -pe "s|%${placeholder}%|${!placeholder}|g" "${network_file}" "${dest_path}/"/*/*.yml
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue