This repository was archived by the owner on Jun 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
228 lines (207 loc) · 5.45 KB
/
docker-compose.yml
File metadata and controls
228 lines (207 loc) · 5.45 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
version: "3.7"
services:
api:
&api
build:
context: .
dockerfile: ./tools/docker/Dockerfile
restart: unless-stopped
volumes:
- ./:/app
ports:
- 8000:8000
depends_on:
- db
environment:
- ALLOWED_HOSTS=localhost,127.0.0.1,api
- DJANGO_ENV=development
- DJANGO_SECRET_KEY=secret
- ENABLE_SSL=false
- DATABASE_URL=postgres://dhost:dhost@db:5432/dhost
- REDIS_URL=redis://cache:6379/1
- CELERY_BROKER_URL=redis://broker:6379/1
- CELERY_RESULT_BACKEND=redis://broker:6379/1
- EMAIL_HOST=mailhog
- EMAIL_PORT=1025
- IPFS_HTTP_API_URL=http://ipfs:5001/api/
- SOCIAL_AUTH_GITHUB_KEY=dc0a656e0c456be2a953
- SOCIAL_AUTH_GITHUB_SECRET=f633ffffc2bde5b3633703494b07325b35e1f3e1
- IPFS_CLUSTER_API_URL=http://cluster0:9094/
networks:
- backends
- cluster
# It runs 3 cluster peers (cluster0, cluster1...) attached to go-ipfs daemons
# 3 cluster peers (cluster0, cluster1, cluster2) attached to go-ipfs daemons (ipfs0, ipfs1, ipfs2) using the CRDT consensus component.
# For persistance, a "data" folder is created and used to store configurations and states
# cluster peer0
ipfs0:
container_name: ipfs0
image: ipfs/go-ipfs:release
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:
- ./data/ipfs0:/data/ipfs
- ./media/ipfs:/export
networks:
- cluster
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.
# - "9096:9096" # Cluster IPFS Proxy endpoint
volumes:
- ./data/cluster0:/data/ipfs-cluster
networks:
- cluster
# cluster peer1
ipfs1:
container_name: ipfs1
image: ipfs/go-ipfs:release
volumes:
- ./data/ipfs1:/data/ipfs
networks:
- cluster
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:
- ./data/cluster1:/data/ipfs-cluster
networks:
- cluster
# cluster peer2
ipfs2:
container_name: ipfs2
image: ipfs/go-ipfs:release
volumes:
- ./data/ipfs2:/data/ipfs
networks:
- cluster
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:
- ./data/cluster2:/data/ipfs-cluster
networks:
- cluster
worker:
<<: *api
command: celery -A dhost worker --loglevel=info -n worker
ports: []
scheduler:
<<: *api
command: celery -A dhost beat --loglevel=info
ports: []
db:
image: postgres
restart: unless-stopped
environment:
- POSTGRES_USER=dhost
- POSTGRES_PASSWORD=dhost
volumes:
- db:/var/lib/postgresql/data
networks:
- backends
broker:
image: redis
restart: unless-stopped
ports:
- 6479:6379
networks:
- backends
cache:
image: redis
restart: unless-stopped
ports:
- 6379:6379
networks:
- backends
flower:
image: mher/flower
restart: unless-stopped
ports:
- 5555:5555
environment:
- CELERY_BROKER_URL=redis://broker:6379/1
- CELERY_RESULT_BACKEND=redis://broker:6379/1
networks:
- backends
adminer:
image: adminer
restart: unless-stopped
ports:
- 8081:8080
networks:
- backends
mailhog:
image: mailhog/mailhog
restart: unless-stopped
ports:
- 1025:1025
- 8025:8025
networks:
- backends
prometheus:
image: prom/prometheus
restart: unless-stopped
ports:
- 9090:9090
volumes:
- ./tools/prometheus:/etc/prometheus
- prometheus:/prometheus
networks:
- backends
grafana:
image: grafana/grafana
restart: unless-stopped
ports:
- 3030:3000
volumes:
- ./tools/grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
- ./tools/grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards
- grafana:/var/lib/grafana
networks:
- backends
volumes:
db:
driver: local
ipfs_export:
ipfs_data:
prometheus:
grafana:
networks:
backends:
driver: bridge
cluster:
driver: bridge