-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
58 lines (54 loc) · 2.65 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
version: '4.24.0'
services:
policy_api_server:
image: nginx:latest
ports:
- "9000:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
- ./bundles:/usr/share/nginx/bundles
sql_server:
image: postgres
environment:
- POSTGRES_DB=policies
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=postgres
ports:
- '5432:5432'
volumes:
- ./sql/create_tables.sql:/docker-entrypoint-initdb.d/create_tables.sql
- ./sql/fill_tables.sql:/docker-entrypoint-initdb.d/fill_tables.sql
opal_server:
image: permitio/opal-server:latest
environment:
- OPAL_POLICY_BUNDLE_URL=http://policy_api_server
- OPAL_POLICY_SOURCE_TYPE=API
- OPAL_POLICY_REPO_POLLING_INTERVAL=30
- OPAL_DATA_CONFIG_SOURCES={"config":{"entries":[{"url":"postgresql://admin@sql_server:5432/policies","config":{"fetcher":"PostgresFetchProvider","query":"SELECT memberOf.user_id, users.name, groups.name AS groupname FROM memberOf JOIN groups ON memberOf.group_id = groups.group_id JOIN users ON memberOf.user_id = users.user_id;","connection_params":{"password":"postgres"}},"topics":["policy_data"],"dst_path":"users"},{"url":"postgresql://admin@sql_server:5432/policies","config":{"fetcher":"PostgresFetchProvider","query":"SELECT * FROM groups;","connection_params":{"password":"postgres"}},"topics":["policy_data"],"dst_path":"groups"},{"url":"postgresql://admin@sql_server:5432/policies","config":{"fetcher":"PostgresFetchProvider","query":"SELECT * from documents;","connection_params":{"password":"postgres"}},"topics":["policy_data"],"dst_path":"documents"},{"url":"postgresql://admin@sql_server:5432/policies","config":{"fetcher":"PostgresFetchProvider","query":"SELECT memberOf.user_id, users.name AS username, memberOf.group_id, groups.name FROM memberOf JOIN groups ON memberOf.group_id = groups.group_id JOIN users ON memberOf.user_id = users.user_id;","connection_params":{"password":"postgres"}},"topics":["policy_data"],"dst_path":"members"}]}}
ports:
- "7002:7002"
depends_on:
- policy_api_server
opal_client:
image: custom-opal-client
build:
context: .
dockerfile: custom-opal-client.Dockerfile
environment:
- OPAL_SERVER_URL=http://opal_server:7002
- OPAL_LOG_FORMAT_INCLUDE_PID=true
- OPAL_INLINE_OPA_LOG_FORMAT=http
- OPAL_FETCH_PROVIDER_MODULES=opal_common.fetcher.providers,opal_fetcher_postgres.provider
ports:
- "7766:7000"
- "8181:8181"
depends_on:
- opal_server
- sql_server
policy_app:
image: policy-app
build:
context: .
dockerfile: frontend.Dockerfile
ports:
- "8000:8000"