generated from defi-wonderland/ts-turborepo-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
117 lines (116 loc) · 4.17 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
services:
datalayer-postgres-db:
image: postgres:16
restart: always
ports:
- "${DATALAYER_POSTGRES_EXPOSED_PORT:-5432}:5432"
# TODO: remove the comment when processing service persists latest event processed
# volumes:
# - db_data:/var/lib/datalayer-postgres/data
env_file:
- .env
environment:
POSTGRES_DB: ${DATALAYER_PG_DATABASE}
POSTGRES_USER: ${DATALAYER_PG_USER}
POSTGRES_PASSWORD: ${DATALAYER_POSTGRES_PASSWORD}
networks:
- datalayer
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DATALAYER_PG_USER}"]
interval: 5s
timeout: 5s
retries: 5
datalayer-graphql-api:
image: hasura/graphql-engine:v2.23.0
ports:
- "${DATALAYER_HASURA_EXPOSED_PORT:-8082}:8080"
restart: always
env_file:
- .env
environment:
HASURA_GRAPHQL_DATABASE_URL: postgres://${DATALAYER_PG_USER}:${DATALAYER_POSTGRES_PASSWORD}@datalayer-postgres-db:5432/${DATALAYER_PG_DATABASE}
HASURA_GRAPHQL_ENABLE_CONSOLE: ${DATALAYER_HASURA_ENABLE_CONSOLE:-true}
HASURA_GRAPHQL_ADMIN_SECRET: ${DATALAYER_HASURA_ADMIN_SECRET:-secret}
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: ${DATALAYER_HASURA_UNAUTHORIZED_ROLE:-public}
HASURA_GRAPHQL_CORS_DOMAIN: ${DATALAYER_HASURA_CORS_DOMAIN:-*}
HASURA_GRAPHQL_ENABLE_TELEMETRY: ${DATALAYER_HASURA_ENABLE_TELEMETRY:-false}
HASURA_GRAPHQL_EXPERIMENTAL_FEATURES: "bigquery_string_numeric_input"
HASURA_GRAPHQL_BIGQUERY_STRING_NUMERIC_INPUT: "true"
## enable debugging mode. It is recommended to disable this in production
HASURA_GRAPHQL_DEV_MODE: ${DATALAYER_HASURA_DEV_MODE:-true}
HASURA_GRAPHQL_ENABLED_LOG_TYPES: "startup, http-log, webhook-log, websocket-log, query-log"
HASURA_GRAPHQL_ADMIN_INTERNAL_ERRORS: ${DATALAYER_HASURA_ADMIN_INTERNAL_ERRORS:-true}
## uncomment next line to run console offline (i.e load console assets from server instead of CDN)
HASURA_GRAPHQL_CONSOLE_ASSETS_DIR: null
depends_on:
datalayer-postgres-db:
condition: service_healthy
healthcheck:
test: timeout 1s bash -c ':> /dev/tcp/127.0.0.1/8080' || exit 1
interval: 5s
timeout: 2s
retries: 50
start_period: 5s
networks:
- datalayer
indexer-postgres-db:
image: postgres:16
restart: always
ports:
- "${ENVIO_POSTGRES_EXPOSED_PORT:-5433}:5432"
volumes:
- db_data:/var/lib/indexer-postgres/data
env_file:
- .env
environment:
POSTGRES_DB: ${ENVIO_PG_DATABASE}
POSTGRES_USER: ${ENVIO_PG_USER}
POSTGRES_PASSWORD: ${ENVIO_POSTGRES_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${ENVIO_PG_USER}"]
interval: 5s
timeout: 5s
retries: 5
networks:
- indexer
indexer-graphql-api:
image: hasura/graphql-engine:v2.23.0
ports:
- "${HASURA_EXPOSED_PORT:-8080}:${PORT:-8080}"
user: 1001:1001
depends_on:
- "indexer-postgres-db"
restart: always
env_file:
- .env
healthcheck:
test: timeout 1s bash -c ':> /dev/tcp/127.0.0.1/8080' || exit 1
interval: 5s
timeout: 2s
retries: 50
start_period: 5s
networks:
- indexer
indexer:
build:
context: ./apps/indexer
dockerfile: Dockerfile
restart: always
depends_on:
indexer-postgres-db:
condition: service_healthy
indexer-graphql-api:
condition: service_healthy
env_file:
- .env
networks:
- indexer
- datalayer
volumes:
db_data:
ganache-data:
networks:
indexer:
name: indexer_test_network
datalayer:
name: datalayer_test_network