-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
149 lines (138 loc) · 3.33 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
137
138
139
140
141
142
143
144
145
146
147
148
149
services:
postgres:
image: postgres:14
container_name: postgres
command: postgres -c 'max_connections=100'
networks:
- default
ports:
- "5432:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5
migrate:
depends_on:
postgres:
condition: service_healthy
image: openfga/openfga:latest
container_name: migrate
environment:
- OPENFGA_DATASTORE_ENGINE=postgres
- OPENFGA_DATASTORE_URI=postgres://postgres:password@postgres:5432/postgres?sslmode=disable
command: migrate
networks:
- default
openfga:
depends_on:
migrate:
condition: service_completed_successfully
image: openfga/openfga:latest
container_name: openfga
command: run
environment:
- OPENFGA_DATASTORE_ENGINE=postgres
- OPENFGA_DATASTORE_URI=postgres://postgres:password@postgres:5432/postgres?sslmode=disable
- OPENFGA_DATASTORE_MAX_OPEN_CONNS=100 #see postgres container
- OPENFGA_PLAYGROUND_ENABLED=true
networks:
- default
ports:
- "8080:8080" #http
- "8081:8081" #grpc
- "3000:3000" #playground
- "2112:2112" #prometheus metrics
healthcheck:
test:
[
"CMD",
"/usr/local/bin/grpc_health_probe",
"-addr=openfga:8081"
]
interval: 5s
timeout: 30s
retries: 3
east1:
image: docker.io/nats:2.10.9
ports:
- "4222:4222"
- "8222:8222"
volumes:
- east1:/data
configs:
- source: east.conf
target: /example/east.conf
- source: sys.conf
target: /example/sys.conf
# - source: west.conf
# target: /config/west.conf
# - source: central.conf
# target: /config/central.conf
command:
- '-c'
- '/example/east.conf'
# west1:
# image: docker.io/nats:2.10.9
# ports:
# - "4224:4222"
# - "8224:8222"
# volumes:
# - west1:/data
# configs:
# - source: east.conf
# target: /config/east.conf
# - source: west.conf
# target: /config/west.conf
# - source: central.conf
# target: /config/central.conf
# - source: sys.conf
# target: /config/sys.conf
# command:
# - '-c'
# - '/config/west.conf'
# central1:
# image: docker.io/nats:2.10.9
# ports:
# - "4223:4222"
# - "8223:8222"
# volumes:
# - central1:/data
# configs:
# - source: east.conf
# target: /config/east.conf
# - source: west.conf
# target: /config/west.conf
# - source: central.conf
# target: /config/central.conf
# - source: sys.conf
# target: /config/sys.conf
# command:
# - '-c'
# - '/config/central.conf'
# db:
# image: postgres
# restart: always
# environment:
# POSTGRES_USER: example
# POSTGRES_PASSWORD: example
# POSTGRES_DB: example
# ports:
# - "5432:5432"
configs:
sys.conf:
file: './example/sys.conf'
east.conf:
file: './example/east.conf'
# west.conf:
# file: './example/west.conf'
# central.conf:
# file: './example/central.conf'
volumes:
crdb:
east1:
networks:
typhoon: