-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
200 lines (198 loc) · 6.31 KB
/
Copy pathdocker-compose.yml
File metadata and controls
200 lines (198 loc) · 6.31 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
name: 'haf-be'
services:
haf:
image: ${HAF_REGISTRY:-registry.gitlab.syncad.com/hive/haf/instance}:${HAF_VERSION:-9ec94375}
entrypoint: /home/hived/docker_entrypoint.sh
command: $${HAF_COMMAND}
environment:
HAF_COMMAND:
DATADIR: /home/hived/datadir
SHM_DIR: /home/hived/shm_dir
PGCTLTIMEOUT: 600
PG_ACCESS: "
host haf_block_log hafbe_user all trust\n
host haf_block_log haf_admin all trust\n
host postgres haf_admin all trust\n
host haf_block_log pghero all trust\n
host postgres pghero all trust\n
host haf_block_log hafbe_owner all trust\n
"
volumes:
- haf_datadir:/home/hived/datadir
- haf_shmdir:/home/hived/shm_dir
- ./blockchain:/home/hived/datadir/blockchain
- ./scripts/haf-healthcheck.sh:/home/hived/healthcheck.sh
networks:
haf-network:
healthcheck:
test: ["CMD-SHELL","/home/hived/healthcheck.sh"]
interval: 60s
timeout: 10s
retries: 3
start_period: 48h #time for replay to finish
hafah-install:
image: ${HAFAH_REGISTRY:-registry.gitlab.syncad.com/hive/hafah}:${HAFAH_VERSION:-latest}
command:
- install_app
environment:
POSTGRES_URL: postgresql://haf_admin@haf:5432/haf_block_log
networks:
haf-network:
depends_on:
haf:
condition: service_healthy
app-setup:
image: ${BACKEND_REGISTRY:-registry.gitlab.syncad.com/hive/haf_block_explorer}:${BACKEND_VERSION:-latest}
working_dir: /home/hived/haf_block_explorer
entrypoint:
- "/bin/bash"
- "-c"
- "./scripts/install_app.sh $${APP_SETUP_OPTIONS}"
user: $SETUP_UID
environment:
POSTGRES_HOST: haf
APP_SETUP_OPTIONS: --only-apps
# No volume mounts in base config - the Docker image contains all submodules
# For local dev with live submodule changes, use dev.yml which adds the mounts
networks:
haf-network:
depends_on:
haf:
condition: service_healthy
hafah-install:
condition: service_completed_successfully
backend-setup:
image: registry.gitlab.syncad.com/hive/haf_block_explorer:${BACKEND_VERSION:-latest}
command:
- install_app
- --blocksearch-indexes=true
environment:
POSTGRES_HOST: haf
networks:
haf-network:
depends_on:
app-setup:
condition: service_completed_successfully
backend-rep-block-processing:
image: registry.gitlab.syncad.com/hive/haf_block_explorer:${BACKEND_VERSION:-latest}
working_dir: /home/hived/haf_block_explorer
entrypoint:
- "/bin/bash"
- "-c"
- "./submodules/reptracker/scripts/process_blocks.sh --stop-at-block=5000000"
environment:
POSTGRES_HOST: haf
POSTGRES_USER: reptracker_owner
volumes:
- ../submodules/reptracker/scripts:/home/hived/haf_block_explorer/submodules/reptracker/scripts
- ./scripts/block-processing-healthcheck.sh:/home/hived/haf_block_explorer/block-processing-healthcheck.sh
networks:
haf-network:
healthcheck:
test: ["CMD-SHELL","/home/hived/haf_block_explorer/block-processing-healthcheck.sh reptracker_app"]
interval: 60s
timeout: 5s
retries: 20
start_period: 72h #time for sync to finish
depends_on:
backend-setup:
condition: service_completed_successfully
backend-block-processing:
image: registry.gitlab.syncad.com/hive/haf_block_explorer:${BACKEND_VERSION:-latest}
command: "process_blocks"
environment:
POSTGRES_HOST: haf
POSTGRES_USER: hafbe_owner
volumes:
- ./scripts/block-processing-healthcheck.sh:/home/hived/haf_block_explorer/block-processing-healthcheck.sh
networks:
haf-network:
healthcheck:
test: ["CMD-SHELL","/home/hived/haf_block_explorer/block-processing-healthcheck.sh hafbe_app"]
interval: 60s
timeout: 5s
retries: 20
start_period: 72h #time for sync to finish
depends_on:
backend-setup:
condition: service_completed_successfully
backend-postgrest:
image: ${POSTGREST_REGISTRY:-postgrest/postgrest}:${POSTGREST_VERSION:-latest}
ports:
- "3000:3000"
- "3001:3001"
environment:
PGRST_ADMIN_SERVER_PORT: 3001
PGRST_DB_URI: postgresql://hafbe_owner@haf:5432/haf_block_log
PGRST_DB_SCHEMA: hafbe_endpoints
PGRST_DB_ANON_ROLE: hafbe_user
PGRST_DB_POOL: 20
PGRST_DB_POOL_ACQUISITION_TIMEOUT: 10
PGRST_OPENAPI_SERVER_PROXY_URI: http://localhost:3000
PGRST_DB_EXTRA_SEARCH_PATH: hafbe_bal, reptracker_app
networks:
haf-network:
depends_on:
haf:
condition: service_healthy
backend-block-processing:
condition: service_healthy
swagger:
image: ${SWAGGER_REGISTRY:-swaggerapi/swagger-ui}:${SWAGGER_VERSION:-latest}
ports:
- "8080:8080"
profiles:
- swagger
environment:
API_URL: http://localhost:3000/
healthcheck:
test: ["CMD-SHELL","curl -f localhost:8080"]
depends_on:
backend-postgrest:
condition: service_started
pghero:
image: ${PGHERO_REGISTRY:-ankane/pghero}:${PGHERO_VERSION:-latest}
ports:
- "2080:8080"
profiles:
- db-tools
environment:
DATABASE_URL: postgresql://pghero@haf:5432/haf_block_log
PGHERO_USERNAME:
PGHERO_PASSWORD:
networks:
haf-network:
healthcheck:
test: ["CMD-SHELL","wget --no-verbose --tries=1 --spider --spider http://$PGHERO_USERNAME:$PGHERO_PASSWORD@localhost:8080/ || exit 1"]
depends_on:
haf:
condition: service_healthy
pgadmin:
image: ${PGADMIN_REGISTRY:-dpage/pgadmin4}:${PGADMIN_VERSION:-latest}
ports:
- "1080:80"
profiles:
- db-tools
environment:
PGADMIN_DEFAULT_EMAIL:
PGADMIN_DEFAULT_PASSWORD:
volumes:
- pgadmin_data:/var/lib/pgadmin
- ./pgadmin4/servers.json:/pgadmin4/servers.json:ro
networks:
haf-network:
healthcheck:
test: ["CMD-SHELL","wget --no-verbose --tries=1 --spider --spider http://localhost/ || exit 1"]
depends_on:
haf:
condition: service_healthy
networks:
haf-network:
name: haf-network
volumes:
haf_datadir:
driver: local
haf_shmdir:
driver: local
pgadmin_data:
driver: local