-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
144 lines (135 loc) · 3.47 KB
/
docker-compose.yml
File metadata and controls
144 lines (135 loc) · 3.47 KB
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
version: '3'
services:
sse-subgraph:
restart: unless-stopped
build:
context: ./data/sse-subgraph
ports:
- '4092:4092'
# MongoDB
data-api:
image: grafbase/mongodb-data-api:latest
restart: unless-stopped
environment:
MONGODB_DATABASE_URL: 'mongodb://grafbase:grafbase@mongodb:27017'
ports:
- '3000:3000'
depends_on:
- mongodb
networks:
- databases
mongodb:
image: mongo:latest
restart: unless-stopped
environment:
MONGO_INITDB_ROOT_USERNAME: 'grafbase'
MONGO_INITDB_ROOT_PASSWORD: 'grafbase'
INIT_WAIT_SEC: $INIT_WAIT_SEC
ports:
- '27018:27017'
networks:
- databases
# Postgres
postgres:
image: postgres:16
restart: unless-stopped
command: postgres -c 'max_connections=1000'
environment:
POSTGRES_PASSWORD: 'grafbase'
POSTGRES_HOST_AUTH_METHOD: 'md5'
POSTGRES_INITDB_ARGS: '--auth-host=md5'
ports:
- '5432:5432'
networks:
- databases
# Pretty much copy pasted from
# https://www.ory.sh/docs/hydra/5min-tutorial
# https://github.com/ory/hydra/blob/master/quickstart.yml
#
# I only removed the consent service as we don't use it.
hydra:
image: oryd/hydra:v2.2.0
ports:
- '4444:4444' # Public port
- '4445:4445' # Admin port
command: serve -c /etc/config/hydra/hydra.yml all --dev
volumes:
- type: volume
source: hydra-sqlite
target: /var/lib/sqlite
read_only: false
- type: bind
source: ./data/hydra-config
target: /etc/config/hydra
environment:
DSN: 'sqlite:///var/lib/sqlite/db.sqlite?_fk=true'
URLS_SELF_ISSUER: 'http://127.0.0.1:4444'
restart: unless-stopped
depends_on:
- hydra-migrate
networks:
- hydra
hydra-migrate:
image: oryd/hydra:v2.2.0
environment:
DSN: 'sqlite:///var/lib/sqlite/db.sqlite?_fk=true'
command: migrate -c /etc/config/hydra/hydra.yml sql -e --yes
volumes:
- type: volume
source: hydra-sqlite
target: /var/lib/sqlite
read_only: false
- type: bind
source: ./data/hydra-config
target: /etc/config/hydra
restart: on-failure
networks:
- hydra
# Adding a second hydra to act as a different OAuth2 provider
hydra-2:
image: oryd/hydra:v2.2.0
ports:
- '4454:4454' # Public port
- '4455:4455' # Admin port
command: serve -c /etc/config/hydra/hydra.yml all --dev
volumes:
- type: volume
source: hydra-2-sqlite
target: /var/lib/sqlite
read_only: false
- type: bind
source: ./data/hydra-config
target: /etc/config/hydra
environment:
DSN: 'sqlite:///var/lib/sqlite/db.sqlite?_fk=true'
URLS_SELF_ISSUER: 'http://127.0.0.1:4454'
SERVE_PUBLIC_PORT: '4454'
SERVE_ADMIN_PORT: '4455'
restart: unless-stopped
depends_on:
- hydra-migrate
networks:
- hydra-2
hydra-2-migrate:
image: oryd/hydra:v2.2.0
environment:
DSN: 'sqlite:///var/lib/sqlite/db.sqlite?_fk=true'
command: migrate -c /etc/config/hydra/hydra.yml sql -e --yes
volumes:
- type: volume
source: hydra-2-sqlite
target: /var/lib/sqlite
read_only: false
- type: bind
source: ./data/hydra-config
target: /etc/config/hydra
restart: on-failure
networks:
- hydra-2
networks:
hydra:
hydra-2:
databases:
volumes:
hydra-sqlite:
hydra-2-sqlite: