-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
136 lines (131 loc) · 4.32 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
services:
postgres:
build:
context: .
dockerfile: ./docker/pg-Dockerfile
args:
POSTGRES_VERSION: ${POSTGRES_VERSION}
ports:
- 5432:5432
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: ${POSTGRES_USER}
POSTGRES_USER: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
pgadmin:
image: dpage/pgadmin4:${PGADMIN_VERSION}
container_name: pgadmin
restart: always
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
PGADMIN_LISTEN_PORT: 5050
volumes:
- ./docker/pgadmin/servers.json:/pgadmin4/servers.json
depends_on:
postgres:
condition: service_healthy
ports:
- ${PGADMIN_LISTEN_PORT}:5050
# Note: The proxy service is only necessary if you're running a Shannon
# localnet and are unable to use the docker network in bridge mode.
# To use the proxy service, you must run the following command on the host
# to establish a reverse proxy such that docker services in the composition
# will be able to port forward to the localnet services exposed on the host:
# ssh -o StrictHostKeyChecking=no -N -R 26657:localhost:26657 proxyuser@localhost -p 2222
proxy:
build:
context: .
dockerfile: ./docker/proxy.dockerfile
environment:
# This values doesn't deserve the time and setup needed to use with .env.docker file
# they are referenced on package.json script which doesn't load .env.docker file
- USER_NAME=proxyuser
- USER_PASSWORD=proxypass
ports:
- "2222:22"
volumes:
- ~/.ssh/id_rsa.pub:/home/proxyuser/.ssh/authorized_keys
subquery-node:
build:
context: .
dockerfile: ./docker/node.dockerfile
args:
NODE_ENV: ${NODE_ENV:-production}
# anything that is not "true" will avoid start nodemon
# changing this value requires rebuilding the image
WATCH: ${WATCH:-false}
ENDPOINT: ${ENDPOINT}
CHAIN_ID: ${CHAIN_ID:-poktroll}
depends_on:
"postgres":
condition: service_healthy
restart: unless-stopped
environment:
# database connection
DB_USER: ${POSTGRES_USER}
DB_PASS: ${POSTGRES_PASSWORD}
DB_DATABASE: ${POSTGRES_DB}
DB_HOST: postgres
DB_PORT: 5432
# node configuration
NODE_ENV: ${NODE_ENV:-production}
# changing this value requires rebuilding the image
WATCH: ${WATCH:-false}
WORKERS: ${WORKERS:-1}
BATCH_SIZE: ${BATCH_SIZE:-30}
DB_SCHEMA: ${DB_SCHEMA:-poktroll}
### this below only avoids you need to rebuild because are injected on project.yaml with the entrypoint
### if you're using WATCH=true they will be overridden by the rebuild process
START_BLOCK: ${START_BLOCK:-1}
ENDPOINT: ${ENDPOINT:-http://proxy:26657}
CHAIN_ID: ${CHAIN_ID:-poktroll}
# this will manage which dotenv file will be used on every reload
volumes:
# Replaced ./:/app with individual tracked files to avoid the generated code go outside the container
- ./schema.graphql:/home/app/schema.graphql
- ./project.ts:/home/app/project.ts
- ./proto:/home/app/proto
- ./src:/home/app/src
- ignore_types:/home/app/src/types
command:
- ${SUB_COMMAND:-} # set SUB_COMMAND env variable to "test" to run tests
- --unfinalized-blocks=true
healthcheck:
test: ["CMD", "curl", "-f", "http://subquery-node:3000/ready"]
interval: 3s
timeout: 5s
retries: 10
graphql-engine:
image: subquerynetwork/subql-query:${SUBQUERY_GRAPHQL_ENGINE_VERSION}
ports:
- ${SUBQUERY_GRAPHQL_ENGINE_PORT}:3000
depends_on:
"postgres":
condition: service_healthy
"subquery-node":
condition: service_healthy
restart: always
environment:
DB_USER: ${POSTGRES_USER}
DB_PASS: ${POSTGRES_PASSWORD}
DB_DATABASE: ${POSTGRES_DB}
DB_HOST: postgres
DB_PORT: 5432
command:
- --name=${DB_SCHEMA:-poktroll}
- --playground
- --indexer=http://subquery-node:3000
volumes:
ignore_dist:
driver: local
ignore_types:
driver: local
postgres_data:
driver: local