-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yaml
96 lines (91 loc) · 2.77 KB
/
docker-compose.yaml
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
version: '3.7'
services:
postgres:
image: postgres:12.0
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=secret
ports:
- 5432:5432
command: postgres -c max_connections=500 -c shared_buffers=4GB
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
gbe:
build:
context: ./
dockerfile: Dockerfile
image: generic-block-explorer:local
depends_on:
- postgres
environment:
BLOCK_EXPLORER_REPLICATOR_ADDR: 'docker.for.mac.localhost:5678'
BLOCK_EXPLORER_DB_URL: 'postgres://postgres:secret@postgres:5432/postgres?sslmode=disable'
BLOCK_EXPLORER_CONTROLLER_RELOADPERIOD: '1200'
MIGRATE_URL: 'postgres://postgres:secret@postgres:5432/postgres?sslmode=disable'
volumes:
- .artifacts/block-explorer.yaml:/opt/app/config/block-explorer.yaml
- .artifacts/migrate.yaml:/opt/app/config/migrate.yaml
command:
- /bin/bash
- -c
- |
curl https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh > wait.sh
chmod +x wait.sh
./wait.sh "postgres:5432"
./migrate --config=/opt/app/config/migrate.yaml
./block-explorer --config=/opt/app/config/block-explorer.yaml
api:
build:
context: ./
dockerfile: Dockerfile
image: generic-block-explorer:local
depends_on:
- postgres
ports:
- 8080:8080
environment:
BLOCK_EXPLORER_API_DB_URL: 'postgres://postgres:secret@postgres:5432/postgres?sslmode=disable'
BLOCK_EXPLORER_API_LISTEN: ':8080'
volumes:
- .artifacts/api.yaml:/opt/app/config/api.yaml
command:
- /bin/bash
- -c
- |
curl https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh > wait.sh
chmod +x wait.sh
./wait.sh "postgres:5432"
./api --config=/opt/app/config/api.yaml
exporter:
build:
context: ./
dockerfile: Dockerfile
image: generic-block-explorer:local
depends_on:
- postgres
ports:
- 56789:56789
environment:
BLOCK_EXPLORER_EXPORTER_API_DB_URL: 'postgres://postgres:secret@postgres:5432/postgres?sslmode=disable'
BLOCK_EXPLORER_EXPORTER_API_LISTEN: ':56789'
volumes:
- .artifacts/exporter-api.yaml:/opt/app/config/exporter.yaml
command:
- /bin/bash
- -c
- |
curl https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh > wait.sh
chmod +x wait.sh
./wait.sh "postgres:5432"
./exporter-api --config=/opt/app/config/exporter.yaml
frontend:
image: insolar/frontend-block-explorer
depends_on:
- api
ports:
- 8888:80
environment:
API_URL: 'http://api:8080'