-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
75 lines (71 loc) · 1.9 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
version: '3.8'
services:
db:
image: postgres:12-alpine
container_name: db
ports:
- 5432:5432
environment:
POSTGRES_PASSWORD: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 2s
timeout: 5s
retries: 100
node:
container_name: node
image: oven/bun:1.1.26
working_dir: /app
volumes:
- ./src/__tests__/configs/acala.yml:/app/acala.yml
command:
bunx @acala-network/[email protected] -c /app/acala.yml
ports:
- 8000:8000
healthcheck:
# bun image doesn't have wget or curl ...
test: |
bun --eval '
fetch("http://localhost:8000", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ id: 1, jsonrpc: "2.0", method: "system_health", params: [] })
})
.then(res => res.json())
.then(data => {
const exitCode = data.result ? 0 : 1;
process.exit(exitCode)
})
.catch(() => process.exit(1));
'
interval: 2s
timeout: 5s
retries: 100
eth-rpc:
container_name: eth-rpc
image: acala/eth-rpc-adapter:2.8.7
restart: on-failure
depends_on:
node:
condition: service_healthy
ports:
- 8545:8545
extra_hosts:
- host.docker.internal:host-gateway
environment:
- ENDPOINT_URL=ws://node:8000
healthcheck:
test: |
wget -q -O- --post-data='{"id": 1, "jsonrpc": "2.0", "method": "eth_chainId", "params": []}' --header='Content-Type: application/json' http://localhost:8545 || exit 1
interval: 2s
timeout: 5s
retries: 100
test-stack-ready:
image: alpine:latest
restart: on-failure
depends_on:
eth-rpc:
condition: service_healthy
db:
condition: service_healthy
command: echo "test stack ready 🚀"