Created
June 4, 2022 08:02
-
-
Save DutchEllie/c285303ad77f80e000232a26a6e167ed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.4' | |
services: | |
################################################################################## | |
## Cluster PEER 0 ################################################################ | |
################################################################################## | |
ipfs0: | |
container_name: ipfs0 | |
image: ipfs/go-ipfs:master-latest | |
# ports: | |
# - "4001:4001" # ipfs swarm - expose if needed/wanted | |
# - "5001:5001" # ipfs api - expose if needed/wanted | |
# - "8080:8080" # ipfs gateway - expose if needed/wanted | |
volumes: | |
- ./compose/ipfs0:/data/ipfs | |
cluster0: | |
container_name: cluster0 | |
image: cluster-image:latest | |
depends_on: | |
- ipfs0 | |
environment: | |
CLUSTER_PEERNAME: cluster0 | |
CLUSTER_SECRET: "<id>" | |
CLUSTER_IPFSHTTP_NODEMULTIADDRESS: /dns4/ipfs0/tcp/5001 | |
CLUSTER_CRDT_TRUSTEDPEERS: '*' # Trust all peers in Cluster | |
CLUSTER_RESTAPI_HTTPLISTENMULTIADDRESS: /ip4/0.0.0.0/tcp/9094 # Expose API | |
CLUSTER_MONITORPINGINTERVAL: 2s # Speed up peer discovery | |
IPFS_GATEWAY: ipfs0:8080 | |
ports: | |
# Open API port (allows ipfs-cluster-ctl usage on host) | |
- "127.0.0.1:9094:9094" | |
# The cluster swarm port would need to be exposed if this container | |
# was to connect to cluster peers on other hosts. | |
# But this is just a testing cluster. | |
# - "9096:9096" # Cluster IPFS Proxy endpoint | |
volumes: | |
- ./compose/cluster0:/data/ipfs-cluster | |
################################################################################## | |
## Cluster PEER 1 ################################################################ | |
################################################################################## | |
# See Cluster PEER 0 for comments (all removed here and below) | |
ipfs1: | |
container_name: ipfs1 | |
image: ipfs/go-ipfs:master-latest | |
volumes: | |
- ./compose/ipfs1:/data/ipfs | |
cluster1: | |
container_name: cluster1 | |
image: cluster-image:latest | |
depends_on: | |
- ipfs1 | |
environment: | |
CLUSTER_PEERNAME: cluster1 | |
CLUSTER_SECRET: "<id>" | |
CLUSTER_IPFSHTTP_NODEMULTIADDRESS: /dns4/ipfs1/tcp/5001 | |
CLUSTER_CRDT_TRUSTEDPEERS: '*' | |
CLUSTER_MONITORPINGINTERVAL: 2s # Speed up peer discovery | |
IPFS_GATEWAY: ipfs1:8080 | |
volumes: | |
- ./compose/cluster1:/data/ipfs-cluster |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment