-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
96 lines (92 loc) · 2.79 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
version: '3'
volumes:
kc_postgres_data:
driver: local
sdb_postgres_data:
driver: local
services:
kc_postgres:
image: postgres:latest
volumes:
- kc_postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: password
ports:
- 5433:5432
keycloak:
build: .
image: dguhr/keycloak_spicedbtest
environment:
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: password
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: password
KC_DB_URL_HOST: kc_postgres
KC_DB_URL_DATABASE: keycloak
KC_DB_SCHEMA: public
KC_DB_USERNAME: keycloak
KC_DB_PASSWORD: password
KC_HOSTNAME_STRICT: 'false'
KC_HTTP_ENABLED: 'true'
KC_HOSTNAME_ADMIN: localhost
KC_HOSTNAME: localhost
# Keycloak SpiceDB Event Listener SPI configuration
KC_SPI_EVENTS_LISTENER_SPICEDB_EVENTS_SERVICE_HANDLER_NAME: SPICEDB
KC_SPI_EVENTS_LISTENER_SPICEDB_EVENTS_SPICEDB_TOKEN: abcdefgh
KC_SPI_EVENTS_LISTENER_SPICEDB_EVENTS_SPICEDB_HOST: host.docker.internal
KC_SPI_EVENTS_LISTENER_SPICEDB_EVENTS_SPICEDB_PORT: 50051
#KC_SPI_EVENTS_LISTENER_SPICEDB_EVENTS_CLIENT_ID: keycloak-producer
#KC_SPI_EVENTS_LISTENER_SPICEDB_EVENTS_ADMIN_TOPIC: spicedb-topic
#KC_SPI_EVENTS_LISTENER_SPICEDB_EVENTS_BOOTSTRAP_SERVERS: PLAINTEXT://kafka:19092
KC_LOG_LEVEL: INFO, io.dguhr:debug
DEBUG_PORT: "*:8787"
ports:
- 8080:8080
- 8443:8443
- 8787:8787 # debug
entrypoint: ["/opt/keycloak/bin/init.sh"]
depends_on:
- kc_postgres
- spicedb
networks:
default:
aliases:
- keycloak
spicedb:
image: authzed/spicedb
command: "serve --datastore-bootstrap-files /var/lib/spicedb/initial/initial_schema.yml"
restart: "always"
volumes:
- ./schema.yml:/var/lib/spicedb/initial/initial_schema.yml
ports:
- "8081:8080"
- "9090:9090"
- "50051:50051"
environment:
- "SPICEDB_GRPC_PRESHARED_KEY=abcdefgh"
- "SPICEDB_DATASTORE_ENGINE=postgres"
- "SPICEDB_DATASTORE_CONN_URI=postgres://spicedb:secret@sdb-database:5432/spicedb?sslmode=disable"
depends_on:
- "migrate"
migrate:
image: "authzed/spicedb"
command: "migrate head"
restart: "on-failure"
environment:
- "SPICEDB_DATASTORE_ENGINE=postgres"
- "SPICEDB_DATASTORE_CONN_URI=postgres://spicedb:secret@sdb-database:5432/spicedb?sslmode=disable"
depends_on:
- "sdb-database"
sdb-database:
image: postgres:latest
ports:
- "5432:5432"
volumes:
- sdb_postgres_data:/var/lib/postgresql/data
environment:
KEYCLOAK_USER: admin
POSTGRES_USER: spicedb
POSTGRES_PASSWORD: secret
POSTGRES_DB: spicedb