-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
75 lines (72 loc) · 2.46 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
version: '3.7'
services:
postgres:
container_name: dm_db
image: postgres:12-alpine
restart: always
environment:
POSTGRES_DB: ${POSTGRES_DATABASE}
POSTGRES_USER: ${POSTGRES_USERNAME}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
PGTZ: ${POSTGRES_TIMEZONE}
ports:
- target: 5432
published: ${POSTGRES_ENDPOINT_PORT}
protocol: tcp
mode: host
healthcheck:
test: pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"
interval: 10s
timeout: 2s
retries: 10
volumes:
- postgres_data:/var/lib/postgresql/data
graphql-engine:
container_name: dm_hasura
image: hasura/graphql-engine:latest.cli-migrations-v3
ports:
- target: 8080
published: ${HASURA_ENDPOINT_PORT}
protocol: tcp
mode: host
volumes:
- ./services/hasura/migrations:/hasura-migrations
- ./services/hasura/metadata:/hasura-metadata
depends_on:
postgres:
condition: service_healthy
restart: always
environment:
HASURA_GRAPHQL_DATABASE_URL: 'postgres://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@dm_db:5432/${POSTGRES_DATABASE}'
HASURA_GRAPHQL_ENABLE_CONSOLE: ${HASURA_GRAPHQL_ENABLE_CONSOLE}
HASURA_GRAPHQL_ENABLED_LOG_TYPES: ${HASURA_GRAPHQL_ENABLED_LOG_TYPES}
# HASURA_GRAPHQL_UNAUTHORIZED_ROLE: ${HASURA_GRAPHQL_UNAUTHORIZED_ROLE}
## uncomment to retrieve console assets locally (no internet)
# HASURA_GRAPHQL_CONSOLE_ASSETS_DIR: /srv/console-assets
## uncomment next line to set an admin secret
# HASURA_GRAPHQL_ADMIN_SECRET: ${HASURA_GRAPHQL_ADMIN_SECRET}
## uncomment next line for JWT configuration (NextAuth)
# HASURA_GRAPHQL_JWT_SECRET: ${HASURA_GRAPHQL_JWT_SECRET}
HASURA_EVENT_WEBHOOK_SECRET: ${HASURA_EVENT_WEBHOOK_SECRET}
HASURA_EVENT_WEBHOOK_URL: ${HASURA_EVENT_WEBHOOK_URL}
hasura-setup:
container_name: dm_hasura_setup
image: alpine:latest
depends_on:
- graphql-engine
restart: 'no'
volumes:
- ./services/hasura:/usr/local/hasura
entrypoint:
[
'/bin/sh',
'-c',
'cd /usr/local/hasura && chmod +x ./setup.sh && ./setup.sh',
]
environment:
HASURA_GRAPHQL_ENDPOINT: http://graphql-engine:${HASURA_ENDPOINT_PORT}
## uncomment next line to set an admin secret
# HASURA_GRAPHQL_ADMIN_SECRET: ${HASURA_GRAPHQL_ADMIN_SECRET}
POSTGRES_DATABASE: ${POSTGRES_DATABASE}
volumes:
postgres_data: {}