-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
146 lines (139 loc) · 3.79 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
services:
chain:
image: ${CHAIN_IMAGE}
init: true # Faster shutdown by container process not be PID 1
restart: unless-stopped
ports: # expose ports to localhost
- '9944:9944' # ws://
- '9933:9933' # http://
- '30333:30333' # for other nodes
extra_hosts:
- 'host.docker.internal:host-gateway'
volumes:
- './mounts/start-chain.sh:/start-chain.sh'
entrypoint: '/start-chain.sh'
command: ['--alice --chain dev']
healthcheck:
test: "timeout 5 bash -c 'cat < /dev/null > /dev/tcp/localhost/9933' && exit 0 || exit 1"
interval: 10s
timeout: 5s
retries: 10
start_period: 10s
postgres:
image: postgres:12-alpine
restart: unless-stopped
ports:
- ${PG_PORT:-5432}:5432
volumes:
- './mounts/pg-load-extensions.sh:/docker-entrypoint-initdb.d/load-extensions.sh'
environment:
POSTGRES_PASSWORD: postgres
rest-api:
image: ${REST_IMAGE}
profiles:
- ''
init: true
restart: unless-stopped
depends_on:
- chain
- graphql
extra_hosts:
- 'host.docker.internal:host-gateway'
ports:
- ${REST_PORT:-3004}:3000
environment:
POLYMESH_NODE_URL: 'ws://chain:9944'
POLYMESH_MIDDLEWARE_V2_URL: 'http://graphql:3000'
LOCAL_SIGNERS: 'alice,bob,charlie'
LOCAL_MNEMONICS: '//Alice,//Bob,//Charlie'
AUTH_STRATEGY: 'open'
DEVELOPER_UTILS: 'true'
subquery:
image: '${SUBQUERY_IMAGE}'
init: true
restart: unless-stopped
healthcheck:
test: curl --fail http://localhost:3000/meta || exit 1
interval: 20s
retries: 15
start_period: 20s
timeout: 10s
depends_on:
postgres:
condition: service_started
chain:
condition: service_healthy
environment:
NETWORK_ENDPOINT: ws://chain:9944
NETWORK_HTTP_ENDPOINT: http://chain:9933
DB_USER: '${PG_USER:-postgres}'
DB_PASS: '${PG_PASSWORD:-postgres}'
DB_DATABASE: '${PG_DB:-postgres}'
DB_PORT: '${PG_PORT:-5432}'
DB_HOST: '${PG_HOST:-postgres}'
NODE_ENV: local
START_BLOCK: 1
command:
- --batch-size=500
- -f=/app
- --local
graphql:
image: onfinality/subql-query:v1.0.0
ports:
- ${SQ_PORT:-3001}:3000
depends_on:
postgres:
condition: service_started
subquery:
condition: service_healthy
environment:
DB_DATABASE: postgres
DB_USER: '${PG_USER:-postgres}'
DB_PASS: '${PG_PASSWORD:-postgres}'
DB_PORT: '${PG_PORT:-5432}'
DB_HOST: '${PG_HOST:-postgres}'
command:
- --name=public
- --playground
- --indexer=http://subquery:3000
# IMPORTANT - `docker volume create polymesh-vault-volume` needs to be ran
vault:
image: hashicorp/vault:${VAULT_VERSION:-latest}
profiles:
- vault
restart: unless-stopped
ports:
- ${VAULT_PORT:-8200}:8200
volumes:
- polymesh-vault-volume:/vault/data:rw
- ./vault:/vault/config:rw
cap_add:
- IPC_LOCK # Prevents secrets from swapping to disk
entrypoint: vault server -config=/vault/config/vault.json
vault-rest-api:
profiles:
- vault
image: ${REST_IMAGE}
init: true
restart: unless-stopped
depends_on:
chain:
condition: service_healthy
vault:
condition: service_started
graphql:
condition: service_started
extra_hosts:
- 'host.docker.internal:host-gateway'
ports:
- ${REST_PORT:-3004}:3000
environment:
POLYMESH_NODE_URL: 'ws://chain:9944'
POLYMESH_MIDDLEWARE_V2_URL: 'http://graphql:3000'
VAULT_URL: 'http://vault:8200/v1/transit'
VAULT_TOKEN: ${VAULT_TOKEN:-}
AUTH_STRATEGY: 'open'
DEVELOPER_UTILS: 'true'
volumes:
polymesh-vault-volume:
external: true