-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
275 lines (264 loc) · 7.22 KB
/
docker-compose.yml
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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
version: '3.4'
services:
cas:
build:
context: ../go-cas
container_name: go_cas
restart: on-failure
environment:
- AWS_ACCOUNT_ID=000000000000
- AWS_REGION=us-east-1
- AWS_ACCESS_KEY_ID=.
- AWS_SECRET_ACCESS_KEY=.
- AWS_ENDPOINT=http://localstack:4566
- PG_HOST=database
- PG_PORT=5432
- PG_USER=root
- PG_PASSWORD=root
- PG_DB=anchor_db
- ANCHOR_BATCH_SIZE=4
- ANCHOR_BATCH_LINGER=5m
- OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://collector:4318/v1/metrics
depends_on:
localstack:
condition: service_healthy
database:
condition: service_healthy
cas_api:
condition: service_healthy
volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
networks:
- internal
cas_worker:
build:
context: ../ceramic-anchor-service
target: base
restart: unless-stopped
environment:
- NODE_ENV=dev
- APP_MODE=anchor
- APP_PORT=8081
- USE_SMART_CONTRACT_ANCHORS=true
- USE_QUEUE_BATCHES=true
- ANCHOR_CONTROLLER_ENABLED=false
- INCLUDE_BLOCK_INFO_IN_ANCHOR_PROOF=false
- MERKLE_DEPTH_LIMIT=0
- MIN_STREAM_COUNT=1
- IPFS_API_URL=http://cas_ipfs:5001
- IPFS_PUBSUB_TOPIC=/integration-tests-docker
- IPFS_API_TIMEOUT=60000
- IPFS_CONCURRENT_GET_LIMIT=100
- BLOCKCHAIN_CONNECTOR=ethereum
- ETH_NETWORK=ganache
- ETH_OVERRIDE_GAS_CONFIG=false
- ETH_GAS_LIMIT=6721975
- ETH_RPC_URL=http://ganache:8545
- ETH_WALLET_PK=0x06dd0990d19001c57eeea6d32e8fdeee40d3945962caf18c18c3930baa5a6ec9
- ETH_CONTRACT_ADDRESS=0xd3f84cf6be3dd0eb16dc89c972f7a27b441a39f2
- LOG_LEVEL=debug
- LOG_TO_FILES=true
- LOG_PATH=/usr/local/var/log
- DB_NAME=anchor_db
- DB_HOST=database
- DB_PORT=5432
- DB_USERNAME=root
- DB_PASSWORD=root
- SQS_QUEUE_URL=http://localstack:4566/000000000000/cas-anchor-dev-
- AWS_ACCOUNT_ID=000000000000
- AWS_REGION=us-east-1
- AWS_ACCESS_KEY_ID=.
- AWS_SECRET_ACCESS_KEY=.
depends_on:
localstack:
condition: service_healthy
database:
condition: service_healthy
cas_ipfs:
condition: service_healthy
cas_api:
condition: service_healthy
launch_contract:
condition: service_completed_successfully
networks:
- internal
deploy:
mode: replicated
replicas: 1
cas_api:
build:
context: ../ceramic-anchor-service
target: base
container_name: cas_api
environment:
- NODE_ENV=dev
- APP_MODE=server
- APP_PORT=8081
- ANCHOR_CONTROLLER_ENABLED=false
- ANCHOR_EXPIRATION_PERIOD=0
- ANCHOR_SCHEDULE_EXPRESSION=0/1 * * * ? *
- BLOCKCHAIN_CONNECTOR=ethereum
- ETH_GAS_LIMIT=4712388
- ETH_GAS_PRICE=100000000000
- ETH_NETWORK=ganache
- ETH_RPC_URL=http://ganache:8545
- ETH_OVERRIDE_GAS_CONFIG=false
- ETH_WALLET_PK=0x06dd0990d19001c57eeea6d32e8fdeee40d3945962caf18c18c3930baa5a6ec9
- ETH_CONTRACT_ADDRESS=0xd3f84cf6be3dd0eb16dc89c972f7a27b441a39f2
- IPFS_API_URL=http://cas_ipfs:5001
- IPFS_API_TIMEOUT=120000
- LOG_LEVEL=debug
- LOG_TO_FILES=true
- LOG_PATH=/usr/local/var/log
- MERKLE_DEPTH_LIMIT=0
- DB_NAME=anchor_db
- DB_HOST=database
- DB_PORT=5432
- DB_USERNAME=root
- DB_PASSWORD=root
- VALIDATE_RECORDS=false
- AWS_ACCOUNT_ID=000000000000
- AWS_REGION=us-east-1
- AWS_ACCESS_KEY_ID=.
- AWS_SECRET_ACCESS_KEY=.
- SQS_QUEUE_URL=http://localstack:4566/000000000000/cas-anchor-dev-
depends_on:
cas_ipfs:
condition: service_healthy
database:
condition: service_healthy
launch_contract:
condition: service_completed_successfully
ports:
- '8081:8081'
networks:
- internal
healthcheck:
test: ['CMD', 'curl', 'http://localhost:8081/api/v0/healthcheck']
interval: 10s
retries: 5
start_period: 30s
timeout: 10s
cas_ipfs:
image: ceramicnetwork/go-ipfs-daemon
container_name: cas_ipfs
ports:
- '5001:5001'
- '8111:8011'
networks:
- internal
database:
image: 'postgres'
container_name: database
environment:
- POSTGRES_USER=root
- POSTGRES_PASSWORD=root
- POSTGRES_DB=anchor_db
ports:
- '5432:5432'
networks:
- internal
healthcheck:
test: ['CMD-SHELL', 'pg_isready', '-d', 'anchor_db', '-U', 'root']
interval: 10s
timeout: 5s
retries: 5
localstack:
image: localstack/localstack
container_name: localstack
ports:
- '4563-4584:4563-4584'
- '8055:8080'
environment:
- SERVICES=sqs,dynamodb
networks:
- internal
volumes:
- ./aws:/etc/localstack/init/ready.d
healthcheck:
test:
- CMD
- bash
- -c
- awslocal dynamodb list-tables
&& awslocal es list-domain-names
&& awslocal s3 ls
&& awslocal sqs list-queues
interval: 5s
timeout: 10s
start_period: 10s
ganache:
image: trufflesuite/ganache
container_name: ganache
ports:
- '8545:8545'
entrypoint:
- node
- /app/dist/node/cli.js
- --miner.blockTime=5
- --mnemonic='move sense much taxi wave hurry recall stairs thank brother nut woman'
- --networkId=5777
- --server.host=0.0.0.0
- -l=80000000
networks:
- internal
launch_contract:
build:
context: .
dockerfile: Dockerfile.launchContract
container_name: contract
environment:
- ETH_RPC_URL=http://ganache:8545
- ETH_WALLET_PK=0x06dd0990d19001c57eeea6d32e8fdeee40d3945962caf18c18c3930baa5a6ec9
depends_on:
- ganache
networks:
- internal
remote_ceramic:
image: ceramicnetwork/js-ceramic:latest
container_name: remote_ceramic
ports:
- 7007:7007
- 4011:4011
- 4012:4012
- 5011:5011
- 9011:9011
- 8011:8011
depends_on:
cas_api:
condition: service_healthy
ganache:
condition: service_started
entrypoint: ''
command: >
/bin/bash -c "
cd packages/cli
./bin/ceramic.js daemon --port 7007 --network local --anchor-service-api http://cas_api:8081 --ethereum-rpc http://ganache:8545 --pubsubTopic /integration-tests-docker
"
healthcheck:
test: ['CMD', 'curl', 'http://localhost:7007']
interval: 20s
retries: 5
start_period: 30s
timeout: 10s
networks:
- internal
otel-collector:
container_name: collector
image: otel/opentelemetry-collector-contrib
command: [--config=/etc/otel-collector-config.yaml]
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
ports:
- 1888:1888 # pprof extension
- 8888:8888 # Prometheus metrics exposed by the collector
- 8889:8889 # Prometheus exporter metrics
- 13133:13133 # health_check extension
- 4317:4317 # OTLP gRPC receiver
- 4318:4318 # OTLP http receiver
- 55679:55679 # zpages extension
networks:
- internal
networks:
internal:
driver: bridge