-
Notifications
You must be signed in to change notification settings - Fork 41
/
docker-compose.yaml
198 lines (187 loc) · 5.55 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# SPDX-FileCopyrightText: Copyright 2023 The Minder Authors
# SPDX-License-Identifier: Apache-2.0
services:
minder:
container_name: minder_server
build:
context: .
dockerfile: ./docker/minder/Dockerfile
image: minder:latest
command: [
"serve",
"--grpc-host=0.0.0.0",
"--http-host=0.0.0.0",
"--metric-host=0.0.0.0",
"--db-host=postgres",
"--issuer-url=http://keycloak:8080",
"--config=/app/server-config.yaml",
# If you don't want to store your GitHub client ID and secret in the main
# config file, point to them here:
# "--github-client-id-file=/secrets/github_client_id",
# "--github-client-secret-file=/secrets/github_client_secret",
]
restart: always # keep the server running
read_only: true
ports:
- "8080:8080"
- "8090:8090"
- "9090:9090"
volumes:
- ./server-config.yaml:/app/server-config.yaml:z
- ./flags-config.yaml:/app/flags-config.yaml:z
# If you don't want to store your GitHub client ID and secret in the main
# config file, point to them here:
# - ./.github_client_id:/secrets/github_client_id:z
# - ./.github_client_secret:/secrets/github_client_secret:z
# If you're using a GitHub App, you'll need to provide the private key:
- ./.secrets/:/app/.secrets/:z
- ./.ssh:/app/.ssh:z
environment:
- KO_DATA_PATH=/app/
# Use viper environment variables to set specific paths to keys;
# these values are relative paths in server-config.yaml, but it's not clear
# what they are relative _to_...
- MINDER_AUTH_ACCESS_TOKEN_PRIVATE_KEY=/app/.ssh/access_token_rsa
- MINDER_AUTH_ACCESS_TOKEN_PUBLIC_KEY=/app/.ssh/access_token_rsa.pub
- MINDER_AUTH_REFRESH_TOKEN_PRIVATE_KEY=/app/.ssh/refresh_token_rsa
- MINDER_AUTH_REFRESH_TOKEN_PUBLIC_KEY=/app/.ssh/refresh_token_rsa.pub
- MINDER_AUTH_TOKEN_KEY=/app/.ssh/token_key_passphrase
- MINDER_UNSTABLE_TRUSTY_ENDPOINT=https://api.trustypkg.dev
- MINDER_PROVIDER_GITHUB_APP_PRIVATE_KEY=/app/.secrets/github-app.pem
- MINDER_FLAGS_GO_FEATURE_FILE_PATH=/app/flags-config.yaml
- MINDER_LOG_GITHUB_REQUESTS=1
working_dir: /app
networks:
- app_net
depends_on:
postgres:
condition: service_healthy
keycloak:
condition: service_healthy
openfga:
condition: service_healthy
migrate:
condition: service_completed_successfully
keycloak-config:
condition: service_completed_successfully
nats:
condition: service_healthy
migrate:
container_name: minder_migrate_up
build:
context: .
dockerfile: ./docker/minder/Dockerfile
image: minder:latest
command: [
"migrate",
"up",
"--yes",
"--db-host=postgres",
"--config=/app/server-config.yaml",
]
volumes:
- ./server-config.yaml:/app/server-config.yaml:z
- ./database/migrations:/app/database/migrations:z
environment:
- KO_DATA_PATH=/app/
networks:
- app_net
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
depends_on:
postgres:
condition: service_healthy
openfga:
condition: service_healthy
postgres:
container_name: postgres_container
image: postgres:16.2-alpine
restart: always
user: postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: minder
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
networks:
- app_net
keycloak:
container_name: keycloak_container
image: quay.io/keycloak/keycloak:25.0
command: ["start-dev"]
environment:
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
KC_HEALTH_ENABLED: "true"
healthcheck:
test: ["CMD", "/opt/keycloak/bin/kcadm.sh", "config", "credentials", "--server", "http://localhost:8080", "--realm", "master", "--user", "admin", "--password", "admin"]
interval: 10s
timeout: 5s
retries: 10
ports:
- "8081:8080"
volumes:
- ./identity/themes:/opt/keycloak/themes:z
networks:
- app_net
keycloak-config:
container_name: keycloak_config
image: bitnami/keycloak-config-cli:6.1.6
entrypoint: ["java", "-jar", "/opt/bitnami/keycloak-config-cli/keycloak-config-cli.jar"]
environment:
KEYCLOAK_URL: http://keycloak:8080
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: admin
KC_MINDER_SERVER_SECRET: secret
IMPORT_VARSUBSTITUTION_ENABLED: "true"
IMPORT_FILES_LOCATIONS: /config/*.yaml
volumes:
- ./identity/config:/config:z
networks:
- app_net
depends_on:
keycloak:
condition: service_healthy
openfga:
container_name: openfga
image: openfga/openfga:v1.5.0
command: [
"run",
"--playground-port=8085"
]
healthcheck:
test:
- CMD
- grpc_health_probe
- "-addr=:8081"
ports:
- 8082:8080
- 8083:8081
- 8085:8085
networks:
- app_net
nats:
container_name: nats
image: nats:2.10.18
entrypoint: ["./nats-server"]
command: ["--http_port", "8222", "-js"]
healthcheck:
test: ["CMD", "./nats-server", "-c", "/nats-server.conf", "-t"]
ports:
- 4222:4222 # Clients
- 8222:8222 # HTTP monitoring
networks:
- app_net
networks:
app_net:
driver: bridge