-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
176 lines (161 loc) · 5.46 KB
/
docker-compose.test.yml
File metadata and controls
176 lines (161 loc) · 5.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
version: '3.4'
# This is a test environment docker-compose file that sets up multiple storage providers
# for local testing and development. It runs 3 cluster peers (cluster0, cluster1...)
# attached to kubo daemons (ipfs0, ipfs1...) using the CRDT consensus component.
# Cluster peers autodiscover themselves using mDNS on the docker internal network.
services:
##################################################################################
## Cluster PEER 0 ################################################################
##################################################################################
ipfs0:
container_name: ipfs0
image: ipfs/kubo:release
ports:
- "4001:4001" # ipfs swarm - expose if needed/wanted
- "5004:5001" # ipfs api - expose if needed/wanted
- "8080:8080" # ipfs gateway - expose if needed/wanted
volumes:
- ./compose/ipfs0:/data/ipfs
networks:
- storage-provider-test
cluster0:
container_name: cluster0
image: ipfs/ipfs-cluster:latest
depends_on:
- ipfs0
environment:
CLUSTER_PEERNAME: cluster0
CLUSTER_SECRET: ${CLUSTER_SECRET} # From shell variable if set
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
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.
# - "9095:9095" # Cluster IPFS Proxy endpoint
# - "9096:9096" # Cluster swarm endpoint
volumes:
- ./compose/cluster0:/data/ipfs-cluster
networks:
- storage-provider-test
gitopia-storage0:
container_name: gitopia-storage0
image: gitopia/gitopia-storage:latest
depends_on:
- cluster0
environment:
- IPFS_CLUSTER_PEER_HOST=cluster0
- IPFS_CLUSTER_PEER_PORT=9094
- GIT_SERVER_ID=0
- IPFS_HOST=ipfs0
- IPFS_PORT=5001
- ENABLE_EXTERNAL_PINNING=${ENABLE_EXTERNAL_PINNING:-false}
- PINATA_API_KEY=${PINATA_API_KEY:-}
- PINATA_SECRET_KEY=${PINATA_SECRET_KEY:-}
ports:
- "5001:5000"
volumes:
- ./compose/gitopia-storage0:/var/repos
networks:
- storage-provider-test
##################################################################################
## Cluster PEER 1 ################################################################
##################################################################################
ipfs1:
container_name: ipfs1
image: ipfs/kubo:release
ports:
- "5005:5001"
volumes:
- ./compose/ipfs1:/data/ipfs
networks:
- storage-provider-test
cluster1:
container_name: cluster1
image: ipfs/ipfs-cluster:latest
depends_on:
- ipfs1
environment:
CLUSTER_PEERNAME: cluster1
CLUSTER_SECRET: ${CLUSTER_SECRET}
CLUSTER_IPFSHTTP_NODEMULTIADDRESS: /dns4/ipfs1/tcp/5001
CLUSTER_CRDT_TRUSTEDPEERS: '*'
CLUSTER_MONITORPINGINTERVAL: 2s # Speed up peer discovery
volumes:
- ./compose/cluster1:/data/ipfs-cluster
networks:
- storage-provider-test
gitopia-storage1:
container_name: gitopia-storage1
image: gitopia/gitopia-storage:latest
depends_on:
- cluster1
environment:
- IPFS_CLUSTER_PEER_HOST=cluster1
- IPFS_CLUSTER_PEER_PORT=9094
- GIT_SERVER_ID=1
- IPFS_HOST=ipfs1
- IPFS_PORT=5001
- ENABLE_EXTERNAL_PINNING=${ENABLE_EXTERNAL_PINNING:-false}
- PINATA_API_KEY=${PINATA_API_KEY:-}
- PINATA_SECRET_KEY=${PINATA_SECRET_KEY:-}
ports:
- "5002:5000"
volumes:
- ./compose/gitopia-storage1:/var/repos
networks:
- storage-provider-test
##################################################################################
## Cluster PEER 2 ################################################################
##################################################################################
ipfs2:
container_name: ipfs2
image: ipfs/kubo:release
ports:
- "5006:5001"
volumes:
- ./compose/ipfs2:/data/ipfs
networks:
- storage-provider-test
cluster2:
container_name: cluster2
image: ipfs/ipfs-cluster:latest
depends_on:
- ipfs2
environment:
CLUSTER_PEERNAME: cluster2
CLUSTER_SECRET: ${CLUSTER_SECRET}
CLUSTER_IPFSHTTP_NODEMULTIADDRESS: /dns4/ipfs2/tcp/5001
CLUSTER_CRDT_TRUSTEDPEERS: '*'
CLUSTER_MONITORPINGINTERVAL: 2s # Speed up peer discovery
volumes:
- ./compose/cluster2:/data/ipfs-cluster
networks:
- storage-provider-test
gitopia-storage2:
container_name: gitopia-storage2
image: gitopia/gitopia-storage:latest
depends_on:
- cluster2
environment:
- IPFS_CLUSTER_PEER_HOST=cluster2
- IPFS_CLUSTER_PEER_PORT=9094
- GIT_SERVER_ID=2
- IPFS_HOST=ipfs2
- IPFS_PORT=5001
- ENABLE_EXTERNAL_PINNING=${ENABLE_EXTERNAL_PINNING:-false}
- PINATA_API_KEY=${PINATA_API_KEY:-}
- PINATA_SECRET_KEY=${PINATA_SECRET_KEY:-}
ports:
- "5003:5000"
volumes:
- ./compose/gitopia-storage2:/var/repos
networks:
- storage-provider-test
networks:
storage-provider-test:
external: true