-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.yaml
executable file
·165 lines (159 loc) · 4.8 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
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
version: '3.9'
services:
hasura-engine:
container_name: hasura_engine
image: hasura/graphql-engine:v2.15.2
ports:
- '8080:8080'
depends_on:
db:
condition: service_healthy
prisma-db:
condition: service_healthy
env_file:
- .env.local
environment:
HASURA_GRAPHQL_ENABLE_CONSOLE: 'false'
HASURA_GRAPHQL_DEV_MODE: 'true'
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
HASURA_GRAPHQL_ENABLE_TELEMETRY: 'false'
HASURA_GRAPHQL_JWT_SECRET: '{"type": "RS256","key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlE9g9dr5yaq89gr4lnZ1\nyRb2DKisPhrVmAvVPTcXkFrOzQzJvuIVdnyojTxLOTokqP1tdijb72wPUWQaxuBu\nimIoQAQ2l1z/ovNLgzPQh/c2g8rC3Sq3O4sVgdZSErGGtKviHc++a3V/ZHJ45qJg\nrWposj05q8SHQufP6L6N+xu1wwi8CP9LxJh1gp/RnabPggPMRj09wV6unqcMuK/o\nhL6ycfgeTmVGlcCvULN/tncHw34sGnOBE3kQfghR0KRFGR2PwO4GnIknBebul0W7\n+hrUtlyi2fzP5WUn6n88BLu/2cd99sxOkbG9Gk8TMKb30vOb45ut7CWvt7oFfHow\n7wIDAQAB\n-----END PUBLIC KEY-----\n", "header": {"type": "Cookie", "name": "next-auth.session-token" }, "claims_map": { "x-hasura-allowed-roles": ["user", "anonymous" ], "x-hasura-default-role": "user", "x-hasura-client-id": { "path": "$$.clientId", "default": "" }, "x-hasura-user-id": { "path": "$$.user.id", "default": "" }, "x-hasura-role": { "path": "$$.role", "default": "" }, "x-hasura-username": { "path": "$$.name", "default": "" } } }'
healthcheck:
test:
[
'CMD-SHELL',
'apt-get update -y && apt-get install -y curl && curl --fail http://localhost:8080/healthz || exit 1',
]
interval: 5s
timeout: 3s
retries: 30
networks:
- web
- db
labels:
- 'traefik.enable=true'
- 'traefik.docker.network=web'
- 'traefik.http.routers.hasura-engine.rule=Host(`hasura-engine.postgres.test`)'
restart: unless-stopped
extra_hosts:
- 'host.docker.internal:host-gateway'
hasura-console:
container_name: hasura-console
image: sebpalluel/hasura_cli_with_socat_and_curl:latest
# build:
# context: ./hasura
# dockerfile: Dockerfile
volumes:
- ./hasura:/usr/src/hasura
env_file:
- .env.local
environment:
HASURA_GRAPHQL_ADDRESS: 127.0.0.1
HASURA_RUN_CONSOLE: 'true'
ports:
- '9695:9695'
- '9693:9693'
extra_hosts:
- 'host.docker.internal:host-gateway'
networks:
- web
- db
labels:
- 'traefik.enable=true'
- 'traefik.docker.network=web'
- 'traefik.http.services.hasura-console.loadbalancer.server.port=9695'
- 'traefik.http.routers.hasura-console.rule=Host(`hasura-console.postgres.test`)'
depends_on:
db:
condition: service_healthy
prisma-db:
condition: service_healthy
command: './start.sh'
# tty: true
restart: unless-stopped
mailhog:
container_name: mailhog
image: mailhog/mailhog
logging:
driver: 'none' # disable saving logs
ports:
- '1025:1025' # smtp server
- '8025:8025' # mailcatcher web interface
networks:
- web
extra_hosts:
- 'host.docker.internal:host-gateway'
env_file:
- .env.local
restart: on-failure
db:
container_name: db
image: postgres:13
volumes:
- db_data:/var/lib/postgresql/data
ports:
- '5432:5432'
networks:
- db
restart: unless-stopped
env_file:
- .env.local
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 2s
timeout: 2s
retries: 10
extra_hosts:
- 'host.docker.internal:host-gateway'
prisma-db:
container_name: prisma_db
image: postgres:13
volumes:
- prisma_db_data:/var/lib/postgresql/data
ports:
- '$PRISMA_DB_PORT:5432'
networks:
- db
restart: unless-stopped
env_file:
- .env.local
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 2s
timeout: 2s
retries: 10
extra_hosts:
- 'host.docker.internal:host-gateway'
redis: # Name of container
image: redis
env_file:
- .env.local
ports:
- ${REDIS_PORT}:${REDIS_PORT}
volumes:
- redis:/data
restart: unless-stopped
extra_hosts:
- 'host.docker.internal:host-gateway'
# # Used to have same DNS in docker and on the host machine but unfortunately it doesn't work on Mac
# dps:
# image: defreitas/dns-proxy-server
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# - /etc/resolv.conf:/etc/resolv.conf
# environment:
# - MG_LOG_LEVEL=ERROR
# hostname: dns.mageddo
# networks:
# dps:
# ipv4_address: 172.0.0.10
volumes:
db_data:
prisma_db_data:
redis:
driver: local
networks:
web:
driver: bridge
db:
driver: bridge